Windows 11 upgrade VBA issue

chr1sj

New Member
Joined
Jul 15, 2021
Messages
22
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi all,

I managed to put together a simple macro which is no doubt not the nicest code but it did the job. Having upgraded to Windows 11 it no longer works. All it is supposed to do is save the file to a specific folder using a cell value as the name. I do not have the understanding to see why this no longer works post-upgrade. Can anybody assist with this? I use excel 365 and the code is below:

Sub SaveRaceToLog()
Dim wbNew As Workbook
Dim strFileName As String

Application.ScreenUpdating = False
Application.DisplayAlerts = False

'save worksheet as new workbook
With ActiveSheet
strFileName = .Name & "-" & .Range("P24").Value
.copy
End With

Set wbNew = ActiveWorkbook

wbNew.SaveAs ThisWorkbook.Path & "\settled events log\" & strFileName, xlOpenXMLWorkbook
ActiveWorkbook.Close False

Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub



Thanks,

Chris
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I just tried your suggestion and it has done the trick! Thanks very much indeed for your help Johnny.
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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