LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Avoid compile error if userform doesn't exists???

It is possible to avoid 'compile Error' when calling another macro
and that macro doesn't exists, by using Application.Run.

So, instead of using

Call TheOtherMacro

...you use:

Application.Run "TheOtherMacro"

That way the original macro will still compile, even if
'TheOtherMacro' doesn't exists (yet).


Is it possible to do something similar with UserForms???

If I use:

UserForm1.Show

...and the userForm doesn't exists yet, the code will error during
compile time, but I need my UserForm to be created during macro run,
so is it possible to avoind compile error, if a UserForm doesn't
exists yet, just as if a macro doesn't exists at compile time???


Thanks,

CE


The purpose of compiling code is to very that it will execute without
error at runtime. That precludes, then, that all refs exist at compile
time! For example, using 'Call TheOtherMacro' will compile so long as
the procedure exists, *even if it's empty*! Same holds true for objects
and external refs!

So.., just add the userform and let it sit there until you're ready to
design it.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


 
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
Is there a way to test if a control exists on a userform? Ryan H Excel Programming 4 March 19th 10 02:20 AM
Case select returning error when cell contains #N/A : how must i avoid this error Luc[_8_] Excel Programming 2 January 12th 10 07:57 AM
Compile error in Userform macro watkincm Excel Programming 2 November 8th 07 12:21 AM
VBAProject name compile error, not defined at compile time Matthew Dodds Excel Programming 1 December 13th 05 07:17 PM
MVP Challenge. Erratic Userform Compile Error Seb[_3_] Excel Programming 8 December 20th 03 06:51 PM


All times are GMT +1. The time now is 10:52 AM.

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"