LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Changing Sheet Names

I'm having trouble changing the names of my worksheets in my new workbook,
can someone help? Here is the code that I have. I'm using Visual Studio
2005, Excel 2007 and VB, here is some of the code I have. Thanks!

Dim LCV = New Excel._ExcelApplication
LCV = CreateObject("Excel.Application")
Dim oBook As Excel.Workbook
Dim oBooks As Excel.Workbooks
Dim oSheets As Excel.Sheets
Dim oSheet1 As Excel.Worksheet

oBooks = LCV.Workbooks
oBook = oBooks.Add()
oSheets = oBook.Worksheets <----I get an error saying COM unhandled
oSheet1 = oSheets.Add
oSheet1.Name = "Portfolio"


I know it already has 3 sheets when you create a new workbook, but how do
you change those names?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Sheet names & Workbook names in VBA coding Colin Foster[_5_] Excel Programming 5 July 7th 06 07:04 PM
Changing Sheet Names Gavin Ling Excel Programming 5 January 6th 06 05:58 PM
Changing VB Component Names to match Worksheet names using VBE Philip Excel Programming 1 April 12th 05 05:37 PM
return all worksheet tab names and chart sheet tab names in report - an example DataFreakFromUtah Excel Programming 2 October 6th 04 08:09 PM
changing sheet names Andy Healey Excel Programming 2 October 12th 03 04:43 PM


All times are GMT +1. The time now is 11:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"