billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
Afternoon
Is there a work around to the below seems to work well in other scripts.
The error occurs at the ThisWorkbook.Activate
Thanks All...
Is there a work around to the below seems to work well in other scripts.
The error occurs at the ThisWorkbook.Activate
Thanks All...
Code:
Dim filepath As StringSet wb2 = Workbooks.Add
ThisWorkbook.Activate
ActiveSheet.Copy before:=wb2.Sheets(1)
wb2.Activate
filepath = CreateObject("WScript.Shell").SpecialFolders("Desktop") & Application.PathSeparator
wb2.SaveAs filepath & "Results" & " " & Format(Now, "mm-dd-yy hhmm") & ".xlsx", FileFormat:=51