Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can I create a worksheet in a routine and set the code name at

Gurus please help me out.
How can I create a worksheet in a routine and set the code name at the same
time.
I presently have a routine that ran fine from the immediate window, but
fails when I call it from my form. I got the "out of range" error.
--
kataiwo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default How can I create a worksheet in a routine and set the code name at

I seem to remember there are some restrictions on this, because some
propertties do not exist in the VBE until they are used.
So if you are creating a WS, whilst it exist in the WB (you can see it), it
does "exist" for the purposes of the VBE.
From the Immediate window it will work, because the VBE is open/visible and
consequently that object must be present.
IIRC, you can call some property/method/anything on the newly created WS
first, then the .CodeName will be available.

NickHK

"kataiwo" ...
Gurus please help me out.
How can I create a worksheet in a routine and set the code name at the
same
time.
I presently have a routine that ran fine from the immediate window, but
fails when I call it from my form. I got the "out of range" error.
--
kataiwo



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How can I create a worksheet in a routine and set the code name at


"NickHK" wrote in message
...

IIRC, you can call some property/method/anything on the newly created WS
first, then the .CodeName will be available.


Force a recompile

Application.VBE.CommandBars.FindControl(ID:=578).E xecute


Reply
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
Print routine needed for code pano Excel Worksheet Functions 3 February 11th 07 02:27 PM
Code to Create a new WorkSheet Corey Excel Programming 4 June 20th 06 04:44 AM
How to create a routine Tara Excel Discussion (Misc queries) 1 August 12th 05 02:28 AM
Create a newworksheet with VBA code and put VBA code in the new worksheet module ceshelman Excel Programming 4 June 15th 05 04:37 PM
How would I create a routine that runs every 15 mins? BruceJ[_2_] Excel Programming 2 October 22nd 03 07:31 PM


All times are GMT +1. The time now is 07:55 PM.

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

About Us

"It's about Microsoft Excel"