Solved

VBA using MS Word 2013 will not save Document

Posted on 2014-04-07
7
1,870 Views
Last Modified: 2014-04-12
I am using the following statement to save the MS Word 2013 document after I updated a value in a bookmark.  This is being done with VBA

If ActiveDocument.Saved = False Then ActiveDocument.Save

A Save As dialogue box pops open rather than saving the document, when I click on the Save button in the dialogue box the Save As dialogue box pops open again and the document is not saved.

The code works correctly on the development machine but not on the machine I want the code to run on.  Both machine are running Office 2013 and Windows 7.  The problem is not a permissions problem, I changed the permissions to allow everyone to do everything just to check.
0
Comment
Question by:c7c4c7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 35

Expert Comment

by:Bembi
ID: 39984519
You may check the optional argumetns of the save method. As long as you do not define the arguments, the save methods works with the default settings.
0
 
LVL 15

Expert Comment

by:DrTribos
ID: 39984687
I ran into a similar strangeness in Excel... it was, if you will the reverse problem, I had to save for a change to take effect.

Is it the case that prior to saving the only change to the document is the update to the bookmark?  If so, can I suggest making some other changes with VBA like adding some blank space at the end of a paragraph then trying the save.
0
 

Author Comment

by:c7c4c7
ID: 39984975
I made changes to the document using VBA other than the bookmark and it still doesn't work.

What I don't get is why it works on one machine and not another it's like there is some unique reference that needs to be added, but everything seems to have migrated correctly.

The one thing I see that is different is that the developing machine has reference to something called a Template Project that did not make it over when I copied the .docm to the new machine
0
Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

 
LVL 15

Expert Comment

by:DrTribos
ID: 39984976
The only other thing I can suggest is a corrupt user profile, can you try on the impacted machine under a new profile that you create from scratch?
0
 

Accepted Solution

by:
c7c4c7 earned 0 total points
ID: 39985009
Solved my own problem
In the IDE for VBA under Tools -> Reference the reference to the TemplateProject was marked as missing.  I unchecked it and a miracle occurred, the SaveAs box no longer appeared.
0
 
LVL 15

Expert Comment

by:DrTribos
ID: 39985018
How random - thanks for the follow-up
0
 

Author Closing Comment

by:c7c4c7
ID: 39995875
It worked
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question