[AccessD] Excel Automation Questions

David Emerson newsgrps at dalyn.co.nz
Sun Jan 7 21:23:49 CST 2018


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




More information about the AccessD mailing list