To open excel file from the code...

polina

Registered User.
Local time
Today, 10:11
Joined
Aug 21, 2002
Messages
100
The user wants that after the data is being exported into the excel file, the file opens up automatically.

I export data using this code:

DoCmd.OutputTo acOutputTable, "Wbt_Orders", acFormatXLS, strDb & datExst & ".xls"


Please suggest if I could open excel file from the code?

Thanks
 
Create a macro

you can create a macro using the output to as the action and then at the bottom select table as the object type, Wbt_Orders as the object name, for the output format choose excel and where it says auto start select YES. And place "DoCmd.RunMacro stDocName" where your other code used to be. stDocName is the name of your macro.
 

Users who are viewing this thread

Back
Top Bottom