Thanks for the effort,
Yes, the file would be closed by the user, so having a close button on the
toolbar would not work, since the users could circumvent this by closing
normally, and they will. Even if instructed not to, they will, due to memory
or whatever.
I also tried the alternate close: Workbooks("myFile.XLS").Close
SaveChanges:=False
Nothing works. Any other ideas?
"JLGWhiz" wrote:
> Also, if being closed by code, have you tried this syntax?:
>
> Workbooks("myFile.XLS").Close SaveChanges:=False
>
> "XP" wrote:
>
> > Office 2003 and Win XP;
> >
> > I have a normal XLS file which runs hidden (Window-Hide). This file is run
> > from a toolbar. This hidden file does things to other files from the toolbar
> > and in the process some data gets written into the hidden file, but it is
> > only needed temporarily.
> >
> > The hidden file is shared, so it is set to open read only by default using
> > file properties. Apparently, it is not possible to code this file so when a
> > user closes MS-Excel the hidden file will close itself without warnings,
> > without messages, and without saving? i.e. just drop dead, quietly?
> >
> > I have tried all manner of the following in either and both the Before_Close
> > and Before_Save events:
> >
> > Cancel = True
> > Application.EnableEvents = False
> > Application.DisplayAlerts = False
> > ThisWorkbook.Saved = True
> > ThisWorkbook.Close SaveChanges:= False
> >
> > No matter what I try, I ALWAYS get the save file question. If not
> > impossible, please tell me how it can be done.
> >
> > Thanks much in advance from a very frustrated user.
> >
|