Sheet Tab Name automatically changed. Why?

D

Dandelo

After using the Macro below, Sheet1 is re-named: 79601 ABC EDI RESUBS MACRO

I want the name of the tab to remain: Sheet1

Can someone tell me how I can fix this?

Option Explicit

Sub SaveAsTextFileInABCEDI_TodayFolder_SaveMacro()

' SaveAsTextFileInABCEDI_TodayFolder_SaveMacro Macro

ChDir _
"C:\Program Files\Business Objects\BusinessObjects 5.0\UserDocs\ABC
EDI\Today"
ActiveWorkbook.SaveAs Filename:= _
"C:\Program Files\Business Objects\BusinessObjects 5.0\UserDocs\ABC
EDI\Today\79601 ABC

EDI RESUBS MACRO.txt" _
, FileFormat:=xlText, CreateBackup:=False
ChDir _
"C:\Program Files\Business Objects\BusinessObjects 5.0\UserDocs\ABC
EDI\1ABC Macros"
ChDir _
"C:\Program Files\Business Objects\BusinessObjects 5.0\UserDocs\ABC
EDI\1ABC Macros"
ActiveWorkbook.SaveAs Filename:= _
"C:\Program Files\Business Objects\BusinessObjects 5.0\UserDocs\ABC
EDI\1ABC Macros\79601

ABC EDI RESUBS MACRO.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
 
K

Kevin B

The macro saves the file as a text file and the tab displayed when a text
file is open in Excel is the text file's root name
 
T

Tim Otero

Kevin said:
The macro saves the file as a text file and the tab displayed when a text
file is open in Excel is the text file's root name

I noticed that, too. Dandelo, perhaps if you reverse the order of the
saves...First save as .xls, then as .txt, that would solve the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top