View Single Post
  #1   Report Post  
Amir
 
Posts: n/a
Default Changing the format of an Excel output file made by Microsoft Access

Hello,

I have a question about changing the format of a document made with OutputTo
command.

I have an Access database which I'm exporting some of it's data to an Excel
document. Guess the Access table is named "MyAccessTable". I'm using the
following command to export the data in that table to an excel worksheet and
open it with Excel:

DoCmd.OutputTo acOutputTable , "MyAccessTable",_
acFormatXLS,"C:\ExcelOutputFile.xls",True.

What I wish to do is that after the file is opened in Excel, a procedure in
Excel will run, making all the changes needed in the formatting of the new
Excel file.

I think I will handle writing the code for changing the format in excel, but
what I don't know is how to make that code run automatically right after the
file is made.

How can I make this procedure run right after the outputto command?
Where should the procedure/module code be stored? (In Access? In another
excel file?)


Kind Regards,
Amir.