Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I am currently executing a macro by opening Access and running it from there. Is there another way to execute the macro without opening Access? Something like a script, or anything else. Any suggestions are greatly appreicated! Thanks!

I don't know too much about Access (i.e. nothing <g>) but I have an Excel macro that runs "almost invisibly" when I double click the icon for an specific Excel file. Snippets of the code are shown below.
A Workbook_Open macro, when placed in the ThisWorkbook module of an Excel file, will run as soon the workbook is open.
The application appears briefly, then becomes "invisible" as per the code, then the rest of the code runs and finally the application quits.
So, while I don't know of a way to run a macro without actually opening the app, I can at least run it without having to deal with the application directly. Perhaps Access has the same "on open" capability.
The Excel file uses the following code:
Private Sub Workbook_Open()
'Dim statements snipped
Application.Visible = False
'Code snipped
Application.Quit
End Sub

There are 2 functions within the macro. One function is that it deletes excel files that are more than 28 days old. The other function executes queries that will update tables within Access.

The answer to your question would be no if the tables updates are required. They can't be updated if the database isn't open.
As far as deleting the older than 28 days old Excel files, that's a separate issue completely. You could use a batch file to do that.
Life's more painless for the brainless.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |