Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Why is Word running a macro on startup?


(!)

highlysceptical's Avatar
highlysceptical highlysceptical is offline
Member with 11 posts.
THREAD STARTER
 
Join Date: Oct 2009
Experience: Advanced
07-May-2012, 12:24 PM #1
Angry Why is Word running a macro on startup?
I have an installation of Word where every time I start the program, it runs a macro.

The macro performs a mail merge using a .csv datasource and after running the macro, the .csv file remains locked until I close all open word documents (not just the one(s) associated with the mail merge).

After this occurs, the macro then runs every time I open Word, even though it is not in the normal.dot template and it is not called autoexec!

Can anyone tell me what is going on?
valis's Avatar
Moderator with 63,362 posts.
 
Join Date: Sep 2004
Location: as above
07-May-2012, 12:29 PM #2
is this a business machine or a home pc?

Can you upload a copy of the sheet please?
highlysceptical's Avatar
highlysceptical highlysceptical is offline
Member with 11 posts.
THREAD STARTER
 
Join Date: Oct 2009
Experience: Advanced
07-May-2012, 04:22 PM #3
thanks for the reply.

The pc is both really - business and home.

I don't understand what you are asking me to do. What do you mean by upload a copy of the sheet?
valis's Avatar
Moderator with 63,362 posts.
 
Join Date: Sep 2004
Location: as above
07-May-2012, 04:34 PM #4
just open word, and save the page it opens as something, then attach it here....

Also, is it a .docx format, or .docm? You can probably stop that from happening just by making your starting default page .docx.
highlysceptical's Avatar
highlysceptical highlysceptical is offline
Member with 11 posts.
THREAD STARTER
 
Join Date: Oct 2009
Experience: Advanced
08-May-2012, 10:41 AM #5
Thanks for the clarification.

I have attached a screenshot showing the warning, and the document created once I click "Yes"

As for the opening document format, I wasn't aware that I had set / chosen one. As I mentioned initially, this problem only occurs after running the macro which uses the "word invoice.csv" datasource referred to on the warning. And I really need to get to the bottom of why running that macro is locking the datasource file until I close all documents in Word, because at the moment, it is extremely annoying trying merge a document, create a new datasource file, merge the document, create the datasource etc.
Attached Images
File Type: bmp macro warning 1.bmp (121.7 KB, 60 views)
Attached Files
File Type: docx Doc1.docx (17.5 KB, 53 views)
valis's Avatar
Moderator with 63,362 posts.
 
Join Date: Sep 2004
Location: as above
08-May-2012, 10:49 AM #6
worked fine for me here........it's something on your side.......let me call in a business app expert, be patient.

thanks,

v
WendyM's Avatar
Trusted Advisor with 3,995 posts.
 
Join Date: Jun 2003
Location: Northern California
08-May-2012, 11:05 AM #7
Based on your screenshot and description, it's not running a macro, it's trying to run a mail merge. When you open Word, are all of your mail merge options available to select (see attached screenshot)? If so, drop down the mail merge arrow and choose Normal Word Document. That should remove the data sources from the document. Save the document and reopen it. Any difference?
Attached Thumbnails
Why is Word running a macro on startup?-capture.jpg  
valis's Avatar
Moderator with 63,362 posts.
 
Join Date: Sep 2004
Location: as above
08-May-2012, 11:43 AM #8
Thanks, WendyM.
highlysceptical's Avatar
highlysceptical highlysceptical is offline
Member with 11 posts.
THREAD STARTER
 
Join Date: Oct 2009
Experience: Advanced
08-May-2012, 07:14 PM #9
I assumed that it was running the macro that I use to perform the mail merge.

I have tried opening Word choosing both Yes and No from the security warning dialog. In both cases, most of the mail merge menu options are not available. I can, however, drop down the Start Mail Merge menu and select Normal Word Document, but this does not help. Next time I open Word, I am back to the same situation.

But I come back to the point that this is a problem that has manifest itself across our network, and the root problem seems to be that when we run the macro that performs the mail merge, it doesn't release / free the datasource, so we then cannot overwrite the datasource file (the .csv file) until we have closed all the documents open in Word. So I am assuming that the fundamental error is in the macro (of which I posted what I thought was the relevant section).
WendyM's Avatar
Trusted Advisor with 3,995 posts.
 
Join Date: Jun 2003
Location: Northern California
08-May-2012, 07:42 PM #10
The macro warning you attached is not a warning and it has nothing to do with macros. The message you see will appear for any document with a mail merge source attached to it. It's simply asking whether you want data from the data source included in your document. In order to be running a macro, the document would have to be named .docm instead of .docx.

My best guess is that the macro you run is attaching the data source to all documents, which is why you see that message when you open any document and why it does not release the .csv file.

Can you attach the code for your macro? Unless I overlooked it, you haven't posted any of the macro itself, just the mail merge message and a blank document. Thanks.
Garf13LD's Avatar
Garf13LD Garf13LD is offline
Member with 455 posts.
 
Join Date: Apr 2012
Experience: Intermediate
08-May-2012, 11:25 PM #11
highlysceptical's Avatar
highlysceptical highlysceptical is offline
Member with 11 posts.
THREAD STARTER
 
Join Date: Oct 2009
Experience: Advanced
09-May-2012, 04:18 AM #12
Thank you very much for taking the trouble to help me with this. I have no doubt I am overlooking something obvious, but I just cannot work out what!

I have attached the entire macro as requested.
Attached Files
File Type: txt macro.txt (8.3 KB, 46 views)
WendyM's Avatar
Trusted Advisor with 3,995 posts.
 
Join Date: Jun 2003
Location: Northern California
10-May-2012, 10:10 AM #13
I haven't had a chance to study the macro yet, but you might want to give Garf's solution of deleting normal.dotx a try. Then open a document and see if it still prompts you about the mail merge. If not, run your macro again and then open another document. If it gives you the prompt again, that will confirm that the macro is adding the data source to the normal template.
highlysceptical's Avatar
highlysceptical highlysceptical is offline
Member with 11 posts.
THREAD STARTER
 
Join Date: Oct 2009
Experience: Advanced
12-May-2012, 05:11 AM #14
Thanks for the suggestions. However, they have not solved the problem. I closed Word, deleted the normal.dotm file and reopened Word, and the prompt was still there!

I also checked in Word that I was deleting the file from the correct template folder, and I was. So on opening Word, there was no file in the folder. But as soon as I closed Word, a new normal.dotm file appeared.
Garf13LD's Avatar
Garf13LD Garf13LD is offline
Member with 455 posts.
 
Join Date: Apr 2012
Experience: Intermediate
13-May-2012, 02:45 AM #15
The article is not about deleting normal.dot.
It talks about issuing a command called mailmergereset.
As your mail merge some how gets into your template, you need to "unmerge" it.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑