...

View Full Version : Name a Excel Spreadsheet



hughesmi
08-17-2005, 10:04 AM
Hello.

Is there a way i can add a name to an excel spreadsheet. I know I can send data to excel usuing this



Response.ContentType = "application/vnd.ms-excel"

neocool00
08-17-2005, 08:18 PM
Do you mean name the sheet or the file or something else?

hughesmi
08-18-2005, 09:08 AM
yes, I mean the sheet.

Cyberlord
08-18-2005, 03:16 PM
Here is your answer:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q288130

This is important for you:



'Rename Sheet1 to "Orders", rename Sheet2 to "Totals" and remove Sheet3
Set oOrdersSheet = oSS.Worksheets(1)
oOrdersSheet.Name = "Orders"
Set oTotalsSheet = oSS.Worksheets(2)
oTotalsSheet.Name = "Totals"
oSS.Worksheets(3).Delete



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum