Computing.Net > Forums > Office Software > Execute Macro in Access

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Execute Macro in Access

Reply to Message Icon

Name: accessMacro
Date: February 13, 2008 at 08:16:01 Pacific
OS: windows xp
CPU/Ram: n/a
Product: n/a
Comment:

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!



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: February 13, 2008 at 08:40:32 Pacific
Reply:

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


0

Response Number 2
Name: Jennifer SUMN
Date: February 13, 2008 at 10:14:53 Pacific
Reply:

What does the macro do?

Life's more painless for the brainless.


0

Response Number 3
Name: accessMacro
Date: February 13, 2008 at 10:39:25 Pacific
Reply:

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.


0

Response Number 4
Name: Jennifer SUMN
Date: February 13, 2008 at 11:10:10 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Execute Macro in Access

New columns in Access using macro www.computing.net/answers/office/new-columns-in-access-using-macro/7789.html

Reminders in access www.computing.net/answers/office/reminders-in-access/103.html

Flex Grid in access www.computing.net/answers/office/flex-grid-in-access/129.html