[AccessD] Reports to Excel

JWColby jwcolby at colbyconsulting.com
Mon Apr 30 16:00:02 CDT 2007


When I was exporting data to a range, and the rows/columns varied, I looked
at the source recordset which can tell me the rowcount and (using dao
anyway) the number of fields in the fields collection of the recordset
object which is the width.  I then built the range on-the-fly using a
starting position and the row/columns info. 


John W. Colby
Colby Consulting
www.ColbyConsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
Sent: Monday, April 30, 2007 4:45 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Reports to Excel

Thanks Jim and John,

I used...
".Columns.Borders.Color = vbBlack"
...and this seemed to do the trick...

The export will have a different number of columns and rows each time.  The
above method puts a border around every cell in the worksheet...not just the
data.

If I could isolate just the cells with data...it might look better...but
this will get me by.

The 'macro recording' gave me a longer approach...but it was dependant on a
range...which I'm not sure how to get.

Any ideas?

Thanks,

Mark A. Matte



>From: "JWColby" <jwcolby at colbyconsulting.com>
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: "'Access Developers discussion and problem 
>solving'"<accessd at databaseadvisors.com>
>Subject: Re: [AccessD] Reports to Excel
>Date: Mon, 30 Apr 2007 16:21:08 -0400
>
>EXACTLY how I do it.  Turn on the macro recorder, do the action (border 
>/ background / whatever) turn off the macro recorder, view the code.  
>After that what you do depends on how you want to do the automation.  
>The easiest way is to create a "template" workbook and create the macro 
>in it, then just call the macro (really a sub IIRC) when you are ready 
>to execute that code.
>
>As Jim mentioned, you might want to clean up the code, but you don't 
>have to.
>
>
>John W. Colby
>Colby Consulting
>www.ColbyConsulting.com
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Hale, Jim
>Sent: Monday, April 30, 2007 3:01 PM
>To: 'Access Developers discussion and problem solving'
>Subject: Re: [AccessD] Reports to Excel
>
><format><cells><border>. Use the macro recorder in Excel to create the 
>code.
>You can transfer the resulting code to Access, add an Excel application 
>object, clean up the code if necessary and you are good to go. The 
>macro recorder doesn't generate the prettiest code but it is great at 
>pointing you in the right direction by telling you which objects to 
>use. HTH Jim Hale
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
>Sent: Monday, April 30, 2007 1:14 PM
>To: accessd at databaseadvisors.com
>Subject: Re: [AccessD] Reports to Excel
>
>
>
>Thanks John,
>
>Got it all 'pretty' and stuff.  The only thing left...I need to a put 
>border
>
>around each cell???  Any hints?
>
>Thanks,
>
>Mark A. Matte
>
> >From: "JWColby" <jwcolby at colbyconsulting.com>
> >Reply-To: Access Developers discussion and problem 
> >solving<accessd at databaseadvisors.com>
> >To: "'Access Developers discussion and problem 
> >solving'"<accessd at databaseadvisors.com>
> >Subject: Re: [AccessD] Reports to Excel
> >Date: Mon, 30 Apr 2007 11:48:17 -0400
> >
> >Automation.
> >
> >
> >John W. Colby
> >Colby Consulting
> >www.ColbyConsulting.com
> >
> >-----Original Message-----
> >From: accessd-bounces at databaseadvisors.com
> >[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A 
> >Matte
> >Sent: Monday, April 30, 2007 11:30 AM
> >To: accessd at databaseadvisors.com
> >Subject: [AccessD] Reports to Excel
> >
> >Hello All,
> >
> >I have an A97 db.  Is there a way to export to excel and control what 
> >color the header row is in excel?
> >
> >Thanks,
> >
> >Mark A. Matte
> >
> >_________________________________________________________________
>
>***********************************************************************
>The information transmitted is intended solely for the individual or 
>entity to which it is addressed and may contain confidential and/or 
>privileged material. Any review, retransmission, dissemination or other 
>use of or taking action in reliance upon this information by persons or 
>entities other than the intended recipient is prohibited.
>If you have received this email in error please contact the sender and 
>delete the material from any computer. As a recipient of this email, 
>you are responsible for screening its contents and the contents of any 
>attachments for the presence of viruses. No liability is accepted for 
>any damages caused by any virus transmitted by this email.
>--
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>--
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com

_________________________________________________________________
Download Messenger. Join the im Initiative. Help make a difference today. 
http://im.live.com/messenger/im/home/?source=TAGHM_APR07






More information about the AccessD mailing list