Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print routine needed for code | Excel Worksheet Functions | |||
Code to Create a new WorkSheet | Excel Programming | |||
How to create a routine | Excel Discussion (Misc queries) | |||
Create a newworksheet with VBA code and put VBA code in the new worksheet module | Excel Programming | |||
How would I create a routine that runs every 15 mins? | Excel Programming |