dbTalk Databases Forums  

Renaming worksheets in Excel before doing DTS

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Renaming worksheets in Excel before doing DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Senjaya
 
Posts: n/a

Default 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.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.