Preventing Save Dialogs from displaying

  • Thread starter Thread starter Everett
  • Start date Start date
E

Everett

Hello All!

I am using Excel 2000 to open and view Excel 5.0/95
spreadsheets.

In my application, once I have made a modification to a
spreadsheet (behind the scenes I am modifying the ZOOM
percentage), I call the Save procedure to save my work.

This is fine and dandy, but, after that, I get a dialog
similar to the following:

"FileABC.xls is a Microsoft Excel 5.0/95 Workbook. Do you
want to overwrite it with the latest Excel format?

* To overwrite it, click Yes.
* To save in the current format, click No."

Right now, I am electing to click on "NO" thereby saving
my file in the original format. Is there a way make this
dialog invisible to the user? I don't want them to have
to click anything as I need to make this invisible to them.

Any suggestions or ideas?

Thanks,
Everett
 
Change this line:

..Parent.Close SaveChanges:=True

To these three:
application.displayalerts = false
..Parent.Close SaveChanges:=True
application.displayalerts = true

(also posted at your initial thread)
 
Dave:

Thanks again for your reply!

I modified my code as you suggested, but, the changes that
I am making to the Scaling percent now are not saving.
For example, my code looks like the following:

XLApp.WorkBooks.Open('abc.xls', 0, false);
sheet := XLApp.WorkBooks[1].Worksheets[1];
MyZoom := 75;
pSetup := 'PAGE.SETUP(,,,,';
pSetup := pSetup + ',,,,,';
pSetup := pSetup + ',,,' + IntToStr(myZoom) + ',';
pSetup := pSetup + ',,,,';
pSetup := pSetup + ',,,)';
XLApp.Workbooks.Application.ExecuteExcel4Macro(pSetup);
XLApp.DisplayAlerts := False;
XLApp.ActiveWorkbook.Save;
XLApp.WorkBooks.Close;
XLApp.DisplayAlerts := True;

HOWEVER, when I go an open the spreadsheet to see if the
changes took, the zoom is still set the the same
percentage that it was at before I attempted to make the
changes.

Also, based on info that I found on the MS site, it says
in one of the examples that :

This example closes the workbook Book1.xls and doesn't
prompt the user to save changes. Any changes to Book1.xls
aren't saved.

Application.DisplayAlerts = False
Workbooks("BOOK1.XLS").Close
Application.DisplayAlerts = True

I would indeed want to save the changes, so, how can I
suppress the dialog AND save the changes?

Thanks in advance,
Everett
 
See the other thread.
Dave:

Thanks again for your reply!

I modified my code as you suggested, but, the changes that
I am making to the Scaling percent now are not saving.
For example, my code looks like the following:

XLApp.WorkBooks.Open('abc.xls', 0, false);
sheet := XLApp.WorkBooks[1].Worksheets[1];
MyZoom := 75;
pSetup := 'PAGE.SETUP(,,,,';
pSetup := pSetup + ',,,,,';
pSetup := pSetup + ',,,' + IntToStr(myZoom) + ',';
pSetup := pSetup + ',,,,';
pSetup := pSetup + ',,,)';
XLApp.Workbooks.Application.ExecuteExcel4Macro(pSetup);
XLApp.DisplayAlerts := False;
XLApp.ActiveWorkbook.Save;
XLApp.WorkBooks.Close;
XLApp.DisplayAlerts := True;

HOWEVER, when I go an open the spreadsheet to see if the
changes took, the zoom is still set the the same
percentage that it was at before I attempted to make the
changes.

Also, based on info that I found on the MS site, it says
in one of the examples that :

This example closes the workbook Book1.xls and doesn't
prompt the user to save changes. Any changes to Book1.xls
aren't saved.

Application.DisplayAlerts = False
Workbooks("BOOK1.XLS").Close
Application.DisplayAlerts = True

I would indeed want to save the changes, so, how can I
suppress the dialog AND save the changes?

Thanks in advance,
Everett
-----Original Message-----
Change this line:

..Parent.Close SaveChanges:=True

To these three:
application.displayalerts = false
..Parent.Close SaveChanges:=True
application.displayalerts = true

(also posted at your initial thread)


--

Dave Peterson
(e-mail address removed)
.
 
You're welcome again.
Hello Again Dave!

I just wanted to be sure to post a "success" message
concerning this thread.

First, let me commend you for your follow through on my
original post. I was really not certain that anyone would
post suggestions and/or ideas. Not only that, after I got
your first reply, I was certain that you, and no one else
would go back to previous days to follow up with "older"
issues. However, I am pleased to state that I was wrong,
and, I am very impressed with your level of expertise and
professionalism.

At this point, my solution has been "cleared for
release". With your help and direction, I was able to
implement a solution that not only met, but, exceeded the
users' expectations.

Again, I just wanted to say "Thank You Much" for your help.

Regards,
Everett
-----Original Message-----
See the other thread.
Dave:

Thanks again for your reply!

I modified my code as you suggested, but, the changes that
I am making to the Scaling percent now are not saving.
For example, my code looks like the following:

XLApp.WorkBooks.Open('abc.xls', 0, false);
sheet := XLApp.WorkBooks[1].Worksheets[1];
MyZoom := 75;
pSetup := 'PAGE.SETUP(,,,,';
pSetup := pSetup + ',,,,,';
pSetup := pSetup + ',,,' + IntToStr(myZoom) + ',';
pSetup := pSetup + ',,,,';
pSetup := pSetup + ',,,)';
XLApp.Workbooks.Application.ExecuteExcel4Macro(pSetup);
XLApp.DisplayAlerts := False;
XLApp.ActiveWorkbook.Save;
XLApp.WorkBooks.Close;
XLApp.DisplayAlerts := True;

HOWEVER, when I go an open the spreadsheet to see if the
changes took, the zoom is still set the the same
percentage that it was at before I attempted to make the
changes.

Also, based on info that I found on the MS site, it says
in one of the examples that :

This example closes the workbook Book1.xls and doesn't
prompt the user to save changes. Any changes to Book1.xls
aren't saved.

Application.DisplayAlerts = False
Workbooks("BOOK1.XLS").Close
Application.DisplayAlerts = True

I would indeed want to save the changes, so, how can I
suppress the dialog AND save the changes?

Thanks in advance,
Everett

-----Original Message-----
Change this line:

..Parent.Close SaveChanges:=True

To these three:
application.displayalerts = false
..Parent.Close SaveChanges:=True
application.displayalerts = true

(also posted at your initial thread)

Everett wrote:

Hello All!

I am using Excel 2000 to open and view Excel 5.0/95
spreadsheets.

In my application, once I have made a modification to a
spreadsheet (behind the scenes I am modifying the ZOOM
percentage), I call the Save procedure to save my work.

This is fine and dandy, but, after that, I get a dialog
similar to the following:

"FileABC.xls is a Microsoft Excel 5.0/95 Workbook. Do
you
want to overwrite it with the latest Excel format?

* To overwrite it, click Yes.
* To save in the current format, click No."

Right now, I am electing to click on "NO" thereby saving
my file in the original format. Is there a way make
this
dialog invisible to the user? I don't want them to have
to click anything as I need to make this invisible to
them.

Any suggestions or ideas?

Thanks,
Everett

--

Dave Peterson
(e-mail address removed)
.

--

Dave Peterson
(e-mail address removed)
.
 
Back
Top