That doesn't make any sense.
ActiveWorkbook.Close SaveChanges:=False
says to close the workbook without saving.
So it shouldn't be checking to save.
You said that you're trying to save the workbook as an .xlsx file.
that's not what
ActiveWorkbook.Close SaveChanges:=False
is doing...
so.. I think we need some clarification on what you're trying to do.
Are you saving it as .xlsx
or are you exiting without saving?
If you're wanting to exit without saving, you can use:
Activeworkbook.Saved = true
if you simply don't want to see prompts, you can use:
Application.DisplayAlerts = False
If you want to save the current workbook as a .xlsx file format (removing all
macros)
without having a warning prompt, use:
Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\temp\SaveTestNew", FileFormat:=xlWorkbookDefault
Paul
-----------------------------------------
"Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can." - John Wesley
-----------------------------------------
________________________________
From: danielrose02 <dan.rose@parker.com>
To: ExcelVBA@yahoogroups.com
Sent: Tue, July 17, 2012 7:44:37 AM
Subject: [ExcelVBA] How do you skip over or pre-answer an EXCEL dialog box?
I finished my expansion of my VB Macro to compare two spreadsheets. When I try
and save the .XLSM to a .XLSX file, I am receiving a prompt that reads as
follows:
The Title contains "Microsoft Excel"
The body of the dialog box reads as follows:
The following features cannot be saved in macro-free workbooks:
. VB Project
To save a file with these features, click No, and then choose a macro-enabled
file type in the File Type list.
To continue saving as a macro-free workbook, click Yes.
The buttons that appear are:
Yes, No, and Help
I would like to force the Yes button.
How do I do that?
The statement that this is trying to execute in my Macro is:
ActiveWorkbook.Close SaveChanges:=False
[Non-text portions of this message have been removed]
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Tidak ada komentar:
Posting Komentar