How to Specify Output Directory for Macro ?

  • Thread starter Thread starter Mike Thomas
  • Start date Start date
M

Mike Thomas

In Access 2003, we have come to a situation where we need to specify an
output directory for macros which generate Excel files.

Right now, we are running the macros in VB code as below:

DoCmd.RunMacro "GenerateExcelSheet"

If we have the output directory string in a variable, strPath, and strPath =
say "d:\ExcelFile\", is there a way to have the macro generate the
spreadsheet in the strPath directory rather than the application's default
output directory?

Many thanks
MIke Thomas
 
View your GenerateExcelSheet macro in design view and click on the OutputTo
action.

You can add your strPath to the Output File action argument, but I believe
you would also need to add the desired filename as well (i.e. strPath &
filename)
 

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

Back
Top