changing existing spreadsheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I have not done anything like this so....

It's possible to programmatically (in .NET) open an *.xls file, make changes
(specifically rename worksheets) and save the file/changes correct?

Thanks in advance,
Jim
 
Jim,

Try something like

Dim WB As Excel.Workbook
WB = XL.Workbooks.Open("H:\Test\BookName.xls")
WB.Worksheets("OldSheetName").Name = "NewSheetName"
WB.Close True

where XL is your instance of the Excel Application.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

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

Back
Top