Link to home
Start Free TrialLog in
Avatar of nrgtaskmaster
nrgtaskmasterFlag for United States of America

asked on

Microsoft Word 2010 Macro stops working when I close and reopen Word

I am using Microsoft Office 2010, specifically Word 2010. My client wants a button to click to print the current page.

I open Word, I begin recording a macro by adding a button on the Quick Access Toolbar,
I Left Click File, I Left Click Print, I Left CLcik the Drop Down Menu for Current Page, I Left Click Print
Then I Stop Recording.

If I remain in Word the button works fine, If I exit and re-open Word, the Macro does nothing.

I must be skipping something really basic, can anyone help with this?

Not sure if this is relevant but the owner of company may have pointed to a normal.dotm on a network share, in other words he may have changed the default template location.
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Recorded macros can be the basis of repeatable code, but they may well be dependent on context-specific factors.

As a start, I suggest that you post the code that works the first time, and not subsequently.

Note that if you can simplify it, diagnosis will be faster. In fact, sufficient simplification might enable you to spot the problem yourself.
Avatar of nrgtaskmaster

ASKER

Hi GrahamSkan,

The actual code is simply:

Sub PCP()
'
' PCP Macro
' Print Current Page
'
End Sub


I feel pretty confident that the problem is that the Owner loaded up an old 97/2003 Normal.dot. When the workstations were "freshly installed" the macro worked. Owner tweaked and pointed Word to an old Normal.dot and Macro stuff went south.
Additionally, I note that the new default template location is on a network drive. I just added this location to "trusted locations" but can't check if this is the solution for about another hour...
Hi - can you save the macro to a different template and save that template in the MS Word startup folder.  As a general rule macros should not be stored in the Normal template (for reasons as the one you've just discovered).

Cheers,

PS G'day Mr Skan :-)
Sure Dude (can save to different template), now I have to Google about what the MS Word Startup Folder is, I apologize - I am a platform provider - want to virtualize a bunch of servers?, no problem, install Windows and Linux cohabitating comfily, no problem. User applications however are not my forte.
Ahhh... you can find it from the word options I'll check exactly...
File > Options > Advanced > scroll to bottom "General" > File Locations (button)
Leaving it to you Steve (Dude!!!). It's my bed-time.
Wife and daughter have been to a horse show for the past 6 days, first dinner together tonight and I am grilling, I must take a break, gotta see my women! Thanks everyone, I'll be back at this in 9:30 PM or so EST, and looking into the startup folder.
ASKER CERTIFIED SOLUTION
Avatar of DrTribos
DrTribos
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial