export to excel - automatic wrap text

G

Guest

HI,

I use a transfer spreeadsheet for exporting a query to excel

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tbl_queries",
"N:\a_c_attach.xls", True

I export memo fields, with a lot of text. I use that exported file as
attachement in email. The only problem is that the "wrap text" format is not
applied in Excel, and as some fields contains a lot of text, it's not
readable.
How could I apply automatically that format in Excel ? Is it possible to
do it in the VB script used for exporting the query and lauch emails ?

Rds
MArco
 
G

Guest

If you need to format cells within an Excel spreadsheet, you will have to
create an Excel application and open it as a workbook option. Then you can
specifically format the cells however you want.

For your situation, there are two approaches:
1. After the TransferSpreadsheet, open the workbook and format the cells.
2. Create a new workbook, format it as you need it, and use the
CopyObjectFrom method to load the data into it.
 
G

Guest

Hi,

Thanks for your help. In fact, I run a first time my query that transfer MSA
data in my spreadsheet, opened it and format it like I want (wrap text +
other format), saved it and close it.

After, when I re-run my query for exporting MSA data in my spreadsheet, the
format is automatically applied.

Have a nice we
Marco
 
G

Guest

Great! glad it worked for you.

marco said:
Hi,

Thanks for your help. In fact, I run a first time my query that transfer MSA
data in my spreadsheet, opened it and format it like I want (wrap text +
other format), saved it and close it.

After, when I re-run my query for exporting MSA data in my spreadsheet, the
format is automatically applied.

Have a nice we
Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top