Stencils asking for saving when drawing is closed -even they were not edited

Started by Yacine, July 30, 2014, 07:57:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yacine

Does one of you guys has an idea why a stencil would ask me if I want to save it, when it was just editing the drawing and not having set the stencil in edit mode?

I unfortunately cannot upload the stencil as it contains code, that I don't own.

The thing is, I have a stencil that I must have altered in way, that it asks for saving.

I have no idea, where to look. Does anyone have a small idea?
Yacine

wapperdude

1st the dumb question...can you say no, exit without saving?

Do you have access to or a copy of the original?  I ask in case you need to recover the original stencil.

You could try saving with a different name.  That ought to take care of the changes and leave the original unchanged...hopefully.  You could then compare file statistics in Windows Explorer, ultimately deleting the modified version.

HTH
Wapperdude
Visio 2019 Pro

Yacine

Yes I can exit without saving, but it's anoying.
I will try your suggestion. May be it's really just a "file" thing.
Thanks.
Yacine

JuneTheSecond

Are you sure your code in your stencil does not edit your stencil?
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

QuoteAre you sure your code in your stencil does not edit your stencil?
To my knowledge it is not possible for a VBA program to edit code. You can do this only from outside the project.

Would you happen to know what kind of code could do this modification?
Yacine

Jumpy

Yunichi is talking about code, that changes the stencil or opens it in edit mode, not code changing code.

But to still answer the question: Changing VBA code with VBA code:
This explanation is for Excel, but I still think, it applies for Visio, too:

http://www.cpearson.com/excel/vbe.aspx


Yacine

Hi Jumpy,
right, I did not read carefully enough Junichi's post.
But! I did changes - when I wrote them only God and myself knew them - know only God does.
But I definitely did not code anything on purpose, that would modify the stencil in any way.
Yacine

Jumpy

Maybe you somewhere check if stencil is not open, than you open it with code using maybe OpenEx with a wrong parameter, to open in edit mode? A lot of maybes, I know, but can't think of another scenario without seeing some code.

daihashi

Quote from: Yacine on July 31, 2014, 07:06:55 AM
QuoteAre you sure your code in your stencil does not edit your stencil?
To my knowledge it is not possible for a VBA program to edit code. You can do this only from outside the project.

Would you happen to know what kind of code could do this modification?

I know this is kind of an old post, but you can actually edit code using VBA. I did this for a while, but it was not 100% predictable/reliable. So instead I opted to include an "update" button that would appear when I made an actual version update available; a msgbox would also pop up upon document open to notify the user of an available update, and the end user could simply click it if they wished. This method basically would copy modules, forms, classes, etc. from the stencil document to the local document.

The latter method is far more reliable for my use, and allows the user to update when they want to do it; as opposed to the document taking control and locking the screen while VBA updated code... which I imagine was scary for some users.

daihashi

regarding your actual question. Make sure that the properties of the stencil file has "saved" set for True.

Also; here is the code I use in my templates to open the stencil file upon document open (after it downloads the stencil from my server). I had some initial issues with being randomly prompted to save the stencil file, but I no longer have this problem after I started checking the .vss saved properties being set for true... and used the open method listed below.

I'd have to go back and look at my older stencil files, but I think what was causing a save prompt before was that I used "visOpenRW"... or something along those lines, instead of the code shown below.

Application.Documents.OpenEx libraryPATH & libraryFILE, visOpenDocked + visOpenHidden