ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Avoiding display msg when saving a .xlsm file to .xlsx (https://www.excelbanter.com/excel-discussion-misc-queries/446241-avoiding-display-msg-when-saving-xlsm-file-xlsx.html)

Vasanth

Avoiding display msg when saving a .xlsm file to .xlsx
 
Hi

I am running a macro from xlsxm file and in the end i am savng the workbook as xlsx fomat . But i get the display message as

------------------------------------------------------------------

The following feature cannot be saved in macro-free workbooks

.VB Project


To continue saving as macro-free workbook click 'YES'

------------------------------------------------------------------


I click manually yes each time the macro is run. Is there any way to suppress the display message and save it as xlsx file.


Below is the code

ChDir "C:\My documents"
ActiveWorkbook.SaveAs Filename:= _
"C:\My documents\User report.xlsx", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

Please help me in this issue

Claus Busch

Avoiding display msg when saving a .xlsm file to .xlsx
 
Hi Vasanth,

Am Wed, 6 Jun 2012 05:47:14 +0000 schrieb Vasanth:

------------------------------------------------------------------

The following feature cannot be saved in macro-free workbooks

VB Project

To continue saving as macro-free workbook click 'YES'

------------------------------------------------------------------


try:

Application.DisplayAlerts = False
ChDir "C:\My documents"
ActiveWorkbook.SaveAs Filename:= _
"C:\My documents\User report.xlsx", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Application.DisplayAlerts = True


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Bob Flanagan[_4_]

Avoiding display msg when saving a .xlsm file to .xlsx
 
There are a number of cases where Excel will pop-up warning messages.
The case you have is one. Another is in deleting a worksheet. Another
is closing a modified workbook. The approach to stop such messages is
to use the statement

Application.DisplayAlers = False

The danger, is this is a permanent change. So, if it gets set to
false, it will be false for years. Unless changed back with:

Application.DisplayAlers = True

It is best to look for code that does not require the above. For
example,

Activeworkbook.Close False

uses the argument False to suppress the message. Less code and
safer. Or, in your case, copying all the sheets to a new workbook and
then saving as the desired type.

Robert Flanagan
Add-ins.com LLC
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel



On Jun 6, 3:44*am, Claus Busch wrote:
Hi Vasanth,

Am Wed, 6 Jun 2012 05:47:14 +0000 schrieb Vasanth:

------------------------------------------------------------------


The following feature cannot be saved in macro-free workbooks


VB Project


To continue saving as macro-free workbook click 'YES'


------------------------------------------------------------------


try:

Application.DisplayAlerts = False
ChDir "C:\My documents"
ActiveWorkbook.SaveAs Filename:= _
"C:\My documents\User report.xlsx", _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Application.DisplayAlerts = True

Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2




All times are GMT +1. The time now is 07:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com