[AccessD] Excel Automation Questions

Rocky Smolin rockysmolin at bchacc.com
Sun Jan 7 22:03:59 CST 2018


Got it.  I usually find these things by recording a macro.  Works every
time. :)

R


-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Darryl Collins
Sent: Sunday, January 07, 2018 8:01 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Excel Automation Questions

Seven would be the first/top row (mod to suit I would think).

intRow would be the last row

Again you could mod/determine the last row in a few way.
If you need help with Excel, let me know or ask on Excel-L

Or if you know what they are and they don't more you can hard code them
(Clearly 7 is already hard coded).



Cheers
Darryl.

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Rocky Smolin
Sent: Monday, 8 January 2018 2:41 PM
To: 'Access Developers discussion and problem solving'
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] Excel Automation Questions


Thanks. I'll try it.  Looks promising. What's the "7" for?  What's in
intRow?

R


-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
David Emerson
Sent: Sunday, January 07, 2018 7:24 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Excel Automation Questions

Hi Rocky,

Try:
        xlObj.ActiveSheet.Rows("7:" & intRow - 1).EntireRow.AutoFit

Regards

David Emerson
Dalyn Software Ltd
Wellington, New Zealand



-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Rocky Smolin
Sent: Monday, 8 January 2018 2:33 p.m.
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Excel Automation Questions

Dear List(s):

 

I have a client who wants a custom Excel spreadsheet exported from his
Access data.  There is one field which can get quite long and in the report
it's easy - the field width is set in the design view and the Can Grow is
set to yes. So the row height changes with the height of that text box.

 

Normally when I automate a custom spreadsheet from Access I issue the
command on VBA which sets all the field widths to the longest data of any
record for that field.  In this case, however, there may be 300 characters
or more in the exported field, so I need to set that field to a specific
width, like 3 inches or so, and set the field to wrap text.

 

However, the height of that specific row would need to be changed to
accommodate/show all those characters.  But I don't want to set ALL the rows
to a height which will accommodate the largest number of rows of any record.

 

So.is there a way in Excel to accomplish this - to automagically set the
height of a row to accommodate the largest number of lines in a field in
that row?  If so, I can figure out how to do it in VBA by recording a macro.


 

MTIA

 

Rocky Smolin

Beach Access Software

760-683-5777

 <http://www.bchacc.com> www.bchacc.com

 <http://www.e-z-mrp.com> www.e-z-mrp.com

Skype: rocky.smolin

 

 


--
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

--
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



More information about the AccessD mailing list