VB projects and XLM sheets cannot be saved in a macro-free workbook

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
2,797
Office Version
  1. 365
Platform
  1. Windows
I've had this macro running for a couple years with no issue. It basically creates a copy of a sheet in a new WB and then saves it as a .XLSX. With suppressing the alerts it has worked fine until yesterday. I did inspect my file name and is properly formed with .XLSX at the end.

This was posted with no response yet:
Redirecting

Is this a new bug in Excel?


1702075448418.png


Application.DisplayAlerts = False 'Don't display warning about changing file extension
NewWB.SaveAs Filename:=NewPathFile, FileFormat:=xlOpenXMLWorkbook 'Save to xlsx
Application.DisplayAlerts = True
 
@MARK858, Does it work if you remove the 'DisplayAlert' lines & the SendKeys line, Then when the pop up message occurs, tab 3 times and hit Enter? I was under the impression that it would, but I can't test that. :(
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Yes, it works if you manually tab and press enter after the dialog appears
 
Upvote 0
Well it sounds like maybe the 'DisplayAlerts' line might be messing it up.

Can you try it without the DisplayAlert lines of code, but leave the SendKeys line?
 
Upvote 0
I would have thought the send keys should go after the saveas so the dialogue box is visible.
 
Upvote 0
Can you try it without the DisplayAlert lines of code, but leave the SendKeys line?
That defeats the purpose of the thread to not display the dialog box, we know the displayalerts triggers the alert because it uses the Go Back option rather than the old Yes option.
I would have thought the send keys should go after the saveas so the dialogue box is visible.
Tried that and you get the error first
 
Upvote 0
@Fluff, it is a timing issue, the SendKeys take some time to actually send, so as long as the SaveAs dialogue box shows up quicky, it will actually show up prior to the SendKeys being delivered.
 
Upvote 0
Please note that there are various temp files that run and cause hang until they have finished running which I don't get saving manually or without the Sendkeys
 
Upvote 0

Forum statistics

Threads
1,215,086
Messages
6,123,033
Members
449,092
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top