Hi guys,
I'm stuck..
I'm trying to copy one sheet into a new workbook and save this as a variable name ansd then close the original workboo kwithout saving..
Here's where I am and it's not working![Frown :( :(](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f641.png)
Any help would be appreciated.
Thanks,
I'm stuck..
I'm trying to copy one sheet into a new workbook and save this as a variable name ansd then close the original workboo kwithout saving..
Here's where I am and it's not working
![Frown :( :(](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f641.png)
VBA Code:
Set wb = ThisWorkbook
Sheet16.Copy
wb.Activate
Application.DisplayAlerts = False
ThisWorkbook.Saved = True
wb.Close
filename = accno & ".csv"
DTAddress = CreateObject("WScript.Shell").SpecialFolders("Desktop") & Application.PathSeparator
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs DTAddress & filename, FileFormat:=xlCSV
Application.DisplayAlerts = True
Any help would be appreciated.
Thanks,