• SaveAs/Startup folder

    Author
    Topic
    #508279

    I’ve been working with an installation of Win 10/Office 2016 for several months, modifying add-in templates’ VBA projects. A couple days ago, when I click save (both in the VBA editor and the document) the SaveAs dialog box displays. This happens maybe 1 out of 3 Saves. Sometimes if type xxx in the document, and click the Save icon again (on QAT), the document saves without the SaveAs dialog box. Even when the SaveAs dialog box appears and I click Cancel, the template saves with the changes. I thought this might be template-specific (I found a post on line that mentioned the SaveAs loop relating to a corrupt document), but it happens with all template in the installation. Sometimes when I click the Save icon in VBE, a message tells me that Word cannot save because of a file permission issue. I have the Startup folder specified in FileLocations, and the folder has been added as a Trusted Location in Word. Again, for several months I have not had this problem…. nor do I have it in other Win 10/Office 2016 installations.

    Can anyone shed any light on what might be the cause of this? I don’t know what else to check.

    I was using DocumentsCustom Office Templates for my add-in templates, then I switched to c:program files (x86)Microsoft OfficeOffice 16Startup, in both cases trusting the location and specifying the folder as the Startup folder in FileOptionsAdvancedFile Locations. This issue doesn’t occur with every save. After make a minor modification (“xxx” in the document) I click Cancel on the SaveAs dialog box, I run the simple code:

    Msgbox ActiveDocument.Saved

    and the result is False. But if I close the template (without saving) and re-open the “xxx” is in the document. This is one of 4 Office 2016 installations that I’ve worked with, and I have not had this experience with any of the others.

    Many thanks.

    Viewing 3 reply threads
    Author
    Replies
    • #1592329

      I’m not sure I understand what is going on but working on an add-in while it is loaded is fraught with danger/confusion. In effect, Word has opened a read-only copy as the add-in loads and then you are probably opening a second ‘writable’ copy in order to edit it as the ActiveDocument. It is no surprise that you get somewhat dodgy behaviour.

      Try removing it as an add-in before editing the template and see if you get more predictable behaviour.

      • #1592534

        Thanks. I’ve tried unloading the add-in first, and the issue persists. I don’t have a similar issue with other significant-sized add-ins in Word 2016. This, I note, is the only one that has a Reference to an OCX file. Yesterday’s Office Watch newsletter pointed out that security in Office is getting worse, not better. This does seem to be security-related. I re-built the template from scratch, and still no relief.

    • #1592405

      I agree with Andrew.

      I found long ago in a networked environment that if anyone on the network had Word open and had loaded a network version of an Add-In that editing that Add-In was a problem. That is one reason I recommend having Add-Ins that are being used being on the local computer rather than the network. The Add-Ins are stored on the network and local copies are updated as a part of the login process.

      • #1592772

        That’s exactly how all of my clients do it: Add-ins on the network and distributed to the local PC at login.

        I’ve now started having this issue on a Win7/Office 2010 installation. (A different VM of VMWare Workstation for each installation.) I get a SaveAs loop when I save the template I’m working on — about 50% of the time. I have worked with VBA/Word for 20 years, and although I know it’s recommended to unload the template from Startup, it’s not something I’ve ever done, and I’ve never had problems. I have begun unloading recently, and that does not preclude this issue. When I get the SaveAs dialog box, I save the template to the Desktop with the intention of closing Word and moving it back to the Startup folder. But after saving to the Desktop (which appears not to really occur), there is an endless loop of SaveAs dialog boxes until I Cancel. Before starting Word, I move the template from the Startup folder and put it on the Desktop and open/edit from there. Even then, I get the SaveAs folder when I save.

        It’s very annoying and time-consuming and I don’t know what to do!

        Edit: With further testing, I’ve noted something interesting: if I don’t Compile the code, the template is more likely to save as expected If I Compile and then Save, I get the SaveAs loop regardless of what folder the template is in or whether or not it is loaded. More interesting still is that usually the changes I’ve made are saved in the VBA project even though the SaveAs loop occurs and I Cancel.

    • #1592802

      Thank you for the update. I suspect that you are working on a level that is beyond my ability to make further useful suggestions.

      • #1592824

        I started with a chat at the Microsoft website today, and they suggested a speak to a “real person” — after long waits and a couple cut-off calls, I finally (after one hour) spoke to an agent who said they could help me for a fee of $499.

      • #1592825

        I’ve encountered an interesting twist as I’ve tried to resolve this issue. I’m not sure whether this is the same topic or a new one. I exported the VBA project components yesterday so that I could try building a new template to see if that helped. Today I exported a code module (.bas file) that I modified. Today’s export has a padlock icon on the file in Windows Explorer; yesterday’s did not have. See the attached image. I wonder why some, but not other, bas files would have the little padlock to indicate admin rights. Maybe that’s the issue here that is prompting the SaveAs dialog. I’ve never seen a bas file with the padlock icon. Any idea what that might indicate? (So far, exported user forms (frm files) never have the padlock.) Today is the first time I’ve seen it… but this issue seems to become more and more complex.46875-BAS-files

    • #1592891

      That is interesting. Doing a google search, it appears this is because the file is locked to all but a single user.

      But I have no idea on what is happening to cause that to happen without you making active steps as administrator to do so.

      • #1592895

        That seems to be the case. One or two of 8 code modules export to a bas file that has the security icon. I built a new template, imported the user forms and modules, save for the locked modules. I inserted new modules of the same name, open the bas file in Notepad, and copied the code into the new module. For the moment, it seems to function as expected. Fingers crossed!

    Viewing 3 reply threads
    Reply To: SaveAs/Startup folder

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: