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
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