Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 1st, 2005, 08:12 PM
Authorized User
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Changing sheet code name


  I am trying to change the codename of a worksheet using the following code:

  myWorkbook.VBProject.VBComponents(oldSheetName).Na me = NewCodeName

This works fine in excel 2000 but it fails in excel2003 - VBProject is no longer an object of a workbook.

  How do I change the codename of a sheet in excel2003?



Old June 2nd, 2005, 03:49 AM
Friend of Wrox
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Barry

You must set your VBProject to trusted.
Tools-Macro-Security-Trusted publishers tab -Trust access to Visual Basic Project


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Workbook,Copy Sheet,Move Sheet, Close/Save ptrussell2009 Excel VBA 0 June 13th, 2008 02:28 PM
Copying code from one sheet to another jdd0x01 Excel VBA 0 May 28th, 2007 07:11 PM
Changing b/ground col in subform d/sheet thedom Access 2 March 13th, 2007 07:08 AM
VBA code to email excel status sheet daily basis ramavtar Excel VBA 0 December 9th, 2006 05:28 AM
Code to populate multiple sheet into workbook kud Excel VBA 0 June 9th, 2004 11:37 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.