PDA

View Full Version : Problem running Word macro at startup



RichardE
10-28-2004, 11:18 AM
I cannot get a Word startup macro to run using the /m switch. It's worked perfectly in the past but quit working. Nothing changed on the system as far as I know (I know that sounds unbelievable, but...).

Same behavior on both a W2K system with Word 2002 and an XP Pro system with Word 2003 (did work, then quit).

The command is "<path>winword.exe <filename> /m<macroname>". This is being done from a Shell statement in a VB.Net program, but I get the same result when I enter the same command directly in a command window.

I've also tried renaming the macro to AutoOpen (and omitting the /m switch). Same result--it still doesn't run.

Also, I get the same result whether the macro security setting is set to Low (which I don't want my end users to have to do) or High, with the "Trust access to Visual Basic Project" box checked on the Trusted Sources tab.

BTW, the macro works perfectly if I run it manually (i.e., go to Tools/Macro) and select that macro.

Anyone have any idea what's going on? Thanks.

Sandieslover
11-02-2004, 02:17 AM
Hi Richard,

frankly... I haven't a clou, why the macro stoped working suddenly.
The help file says something about macro's that will not run when a document is read only. I asume you did check if the file you want to open isn't suddenly read-only.

Did you try to copy the macro code in the VBA editor in 'ThisDocument" as a macro that activates when the document opens?

If that works, it's still no answere to the WHY q, but you'll have at least a working code.

Regards,

Sandieslover

JOrzech
11-09-2004, 06:14 PM
Long shot but try using a double forward slash in your command line.