Running Word macro from VB6

S

Steve W.

I have a group of macros that I have been running from shortcuts using a
small exe created in Visual Basic 6.0. These macros have been running this
way since Word 98. To run a macro I pass 2 parameters to identify which
macro to run and use this code:

'start Word
Set appWord = CreateObject("Word.Application")
With appWord
.Visible = False
.Run MacroName:=strMacroName
EndWith

where strMacroName is filled with the name of the macro to run. As I said
this has been working since Word98, but now I receive an error message:
"Run-time error 5111: This command is not available on this platform". The
macros are now in Word 2007 and this had been working until I had to add a
new macro to Word and put its edit check in VB6 and recomplie the exe.

Anybody know what I need to run the macros this way.
Thanks
 
C

Clif McIrvin

I'm going to answer only because no one else has yet ....

At a guess, you're running into a security ("trust center" ?) issue ...
you only saw it after your new compile becuase the new .exe didn't
"inherit" the authorizations the old .exe had.

Unfortunately, I've never touched Office 2007 so other than the guess
above I won't be able to help.
 

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