Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Renaming and Creating Worksheets
#1
Ok...this adds tabs with a consecutive number (ie Sheet4, Sheet5, Sheet6, etc...)

Function Rename_Tab
Code:
Copy      Help
out
str sfile="$desktop$\Excel Sheet Names.xls"
Excel.Application app._create
Excel.Workbook book=app.Workbooks.Open(_s.expandpath(sfile))

book.Worksheets.Add

book.Save
book.Close

Is there anyway to get it to add a Sheet with a specified name?

I thought book.Worksheet.Add("NewSheetName") would work, but doesn't
#2
Macro
Code:
Copy      Help
out
str sfile="$personal$\book1.xls"
Excel.Application app._create
Excel.Workbook book=app.Workbooks.Open(_s.expandpath(sfile))
app.Visible=-1
Excel.Worksheet ws=book.Worksheets.Add
ws.Name="test"
;
;book.Save
;book.Close


Forum Jump:


Users browsing this thread: 1 Guest(s)