dreammaker
New Member
- Joined
- May 26, 2010
- Messages
- 17
Hi all,
I am trying to use macros in Access to close both an open excel worksheet based on tables in Access and the access database prior to updating all my tables from a 3rd party software,
Part of the 3rd party software functionality is the use of .bat files, Therefore to open the access database or excel workbook is relatively easy.
My plan was to use the .bat files
@echo off
SET datafile=DB reports
SET macro=Open
REM ---------------- Do not change below this line ----------------
ECHO Interface running for %datafile%.
"C:\Program Files\Microsoft Office\Office12\MSACCESS" "c:\FAS interfaces\%datafile%.mdb" /x %macro%
The above code will allow me to open my database DB reports, and run the macro called Open in the access database,
Now the hard bit,
I need to create a Close Marco, which will see if there is a file call Reports.xls open and if so, close it, without saving, and then close the database DB reports,
The latter bit is a simple close command, does anyone have any ideas on how to kill the excel workbook prior to closing the database.
Many thanks in advance.
DM
I am trying to use macros in Access to close both an open excel worksheet based on tables in Access and the access database prior to updating all my tables from a 3rd party software,
Part of the 3rd party software functionality is the use of .bat files, Therefore to open the access database or excel workbook is relatively easy.
My plan was to use the .bat files
@echo off
SET datafile=DB reports
SET macro=Open
REM ---------------- Do not change below this line ----------------
ECHO Interface running for %datafile%.
"C:\Program Files\Microsoft Office\Office12\MSACCESS" "c:\FAS interfaces\%datafile%.mdb" /x %macro%
The above code will allow me to open my database DB reports, and run the macro called Open in the access database,
Now the hard bit,
I need to create a Close Marco, which will see if there is a file call Reports.xls open and if so, close it, without saving, and then close the database DB reports,
The latter bit is a simple close command, does anyone have any ideas on how to kill the excel workbook prior to closing the database.
Many thanks in advance.
DM