ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sheet Tab Name automatically changed. Why? (https://www.excelbanter.com/excel-discussion-misc-queries/190877-sheet-tab-name-automatically-changed-why.html)

Dandelo

Sheet Tab Name automatically changed. Why?
 
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
--
Thank you so much for your help!

Kevin B

Sheet Tab Name automatically changed. Why?
 
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
--
Kevin Backmann


"Dandelo" wrote:

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
--
Thank you so much for your help!


Dandelo

Sheet Tab Name automatically changed. Why?
 
oh, Okay. I did not know that. thank you very much!
--
Thank you so much for your help!


"Kevin B" wrote:

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
--
Kevin Backmann


"Dandelo" wrote:

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
--
Thank you so much for your help!


Tim Otero

Sheet Tab Name automatically changed. Why?
 
Kevin B wrote:
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.


All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com