At end of a process....want to open an Excel file....getting error...

  • Thread starter robertfuschetto via AccessMonster.com
  • Start date
R

robertfuschetto via AccessMonster.com

I inhereted a user database with a form and a button. Click the button and a
variety of queries run, tables are made etc etc. The end result is to be an
Excel file that opens where the user refreshes a pivot linked to the Access
data base.

The process works fine when I run it. Essentially a bunch of vba code is run
to open queries and such. The last vba statement though calls a macro: DoCmd.
RunMacro "mcrOpenDetailReport". The macro simply issues the RunApp command:
Excel "X:\ABCAccounting\Reports\MyReport.xls".

Like I said it all works fine for me. The report opens on my pc. Whe the
user tries to run it though fails as soon as it hits the DoCmd.RunMacro
"mcrOpenDetailReport code.

I am guessing there is some sort of security issue or in some way the user
lacks the ability to issue the RunnAPP command...not sure.

The use can open the Excel file manually; outside of MsAccess.


Ideas?
 
G

Guest

From the menu bar, Tools, Macro, Security. This may be preventing it.
An alternative is to move the code from the Macro to your module. In place
of where you call the macro, use something like this:

Call Shell("Excel X:\ABCAccounting\Reports\MyReport.xls",
vbMaximizedFocus)
 
R

robertfuschetto via AccessMonster.com

Thanks, will try...
From the menu bar, Tools, Macro, Security. This may be preventing it.
An alternative is to move the code from the Macro to your module. In place
of where you call the macro, use something like this:

Call Shell("Excel X:\ABCAccounting\Reports\MyReport.xls",
vbMaximizedFocus)
I inhereted a user database with a form and a button. Click the button and a
variety of queries run, tables are made etc etc. The end result is to be an
[quoted text clipped - 16 lines]
 
R

robertfuschetto via AccessMonster.com

BTW, the macro security is set to low in the db, like I said it lets me open
the file but not user when they open th db. The Call statement does not work
in the vba...there must be a format issue in the code's verbage....I'll see
if I can figure it out.
From the menu bar, Tools, Macro, Security. This may be preventing it.
An alternative is to move the code from the Macro to your module. In place
of where you call the macro, use something like this:

Call Shell("Excel X:\ABCAccounting\Reports\MyReport.xls",
vbMaximizedFocus)
I inhereted a user database with a form and a button. Click the button and a
variety of queries run, tables are made etc etc. The end result is to be an
[quoted text clipped - 16 lines]
 

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

Top