NotToShabby
New Member
- Joined
- Jun 16, 2005
- Messages
- 11
Anyone -
I am doing two differnt save methods for one file. The first method is to save one of the sheets that has a list of generated datapoints for a helix (x,y,z point locations) and the data needs to be Tab delimited to import into another program. This I can do with the AcitveWorkbook.SaveAs without much problem - the tab and the saved file name can be the same.
Where I am having problems is with the final save. I switch to the main sheet - called "Calc" and run the ActiveWorkbook.saveas. What happens is the tab now will change to whatever file name save the file as. This I can not have as the maco looks specifically for the "Calc" sheet. Running the macro again fails because of the new sheet name.
How do I prevent this from happening????
***************
'Save Tab Delimited Worksheet
FileSaveAs = Excel.ActiveSheet.Name
Excel.ActiveWorkbook.SaveAs Filename:=FileSaveAs, FileFormat:=-4158
'Switch to main sheet
Sheets("calc").Activate
'Prompt for file name
NewFile = Application.GetSaveAsFilename(NewFile)
'Save file
ActiveWorkbook.SaveAs (NewFile)
I am doing two differnt save methods for one file. The first method is to save one of the sheets that has a list of generated datapoints for a helix (x,y,z point locations) and the data needs to be Tab delimited to import into another program. This I can do with the AcitveWorkbook.SaveAs without much problem - the tab and the saved file name can be the same.
Where I am having problems is with the final save. I switch to the main sheet - called "Calc" and run the ActiveWorkbook.saveas. What happens is the tab now will change to whatever file name save the file as. This I can not have as the maco looks specifically for the "Calc" sheet. Running the macro again fails because of the new sheet name.
How do I prevent this from happening????
***************
'Save Tab Delimited Worksheet
FileSaveAs = Excel.ActiveSheet.Name
Excel.ActiveWorkbook.SaveAs Filename:=FileSaveAs, FileFormat:=-4158
'Switch to main sheet
Sheets("calc").Activate
'Prompt for file name
NewFile = Application.GetSaveAsFilename(NewFile)
'Save file
ActiveWorkbook.SaveAs (NewFile)