View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Andy Andy is offline
external usenet poster
 
Posts: 414
Default Does Userform exist?

Hi Chip

Thanks for the reply, the macro needs to be run against different (new)
workbooks every time so there is not one workbook that the users will always
use. However, I take your point that importing modules into people's
personal.xls workbooks is bad program design. Would I therefore be better to
have a workbook with the sole purpose of containing common macros that opens
on startup?

Thanks
Andy

"Chip Pearson" wrote:

There is no way with conditional compilation to determine whether
a userform exists. Why are you assuming that the form should be
in the user's personal.xls workbook? This is bad program design.
Personal.xls is, by definition, where users put the own personal
code. Why don't you put the form in your workbook, so you can be
assured that it exists.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Andy" wrote in message
...
Hi All

I have a macro that makes use of a UserForm for gathering data
from the
user. While the userform should always exist on the users'
machines this
might not always be the case. Is anybody aware of a way of
checking to see
if a UserForm exists in the Personal.xls workbook so I can
handle such
instances? If it doesn't then there is obviously a compile
error so I have
had a look at the #const and #if... directives but can't figure
it out.

Thanks

Andy