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)
 
Back
Top