austin350s10
Active Member
- Joined
- Jul 30, 2010
- Messages
- 321
I have a project I am working on where I would like to save one of the sheets in my workbook as a .csv document. Below is the code I am currently using:
This script does take the export sheet and saves it as the file named myExport.csv. The problem I am having is when I run this script the active workbook is also renamed to export.csv. I would like to leave the active workbook intact. What am I doing wrong here?
Code:
Sub myExport_Click()
Dim ws As Worksheet
Set ws = Worksheets("Export")
ws.SaveAs Filename:="myExport", FileFormat:=6
End Sub
This script does take the export sheet and saves it as the file named myExport.csv. The problem I am having is when I run this script the active workbook is also renamed to export.csv. I would like to leave the active workbook intact. What am I doing wrong here?