Renaming worksheets in Excel before doing DTS -
04-18-2005
, 04:30 PM
Anybody could help me ?
I have 286 tables which contains only 1 worksheet - but the name is 30 char
long and contains some spaces.
I need to change it to simple name like 'datasheet' so it will work in my
DTS loop ....
But somehow the activeX did not work as I want it to.
Function Main()
'use script to rename all sheets to a common name
dim xlObj
Set xlObj = CreateObject("Excel.application")
xlObj.Workbooks.Open
DTSGlobalVariables("gv_FileFullName").value
xlObj.ActiveWorkbook.Sheets(1).Name = "DataSheet"
xlObj.ActiveWorkbook.Save
xlObj.Quit
Set xlObj = Nothing
Main = DTSTaskExecResult_Success
End Function
Any help will be greatly appreciated. |