View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Excel VBA Reference to Forms Object Library (to be unchecked)

Peter,
Whilst it is strange that it is not possible to manually uncheck the Forms2
reference, I do think the OP is barking up the wrong tree on this.
I go for another cause to problem.

NickHK

"Peter T" <peter_t@discussions wrote in message
...
Comments in line below -

wrote in message
oups.com...
On Apr 25, 5:09 pm, "Peter T" <peter_t@discussions wrote:

6. The requirement is to uncheck the reference to Forms Object Library
so that the code modules could be run in order.

Interesting, why?

Regards,
Peter T

__________________________________________________ ____________________

replies :-

The affected code modules could be copied to a new workbook ; and
there, the code runs "flawlessly". Upon examination, Tools
References, Microsoft Forms 2.0 Object Library is not checked in the
new workbook.

When the code is run in the original workbook, it causes an error,
"Type Mismatch". The error does not recur when the code is run in the
new workbook.


Where do you get a "Type Mismatch"

If there's a simple way to uncheck the Forms Object Library in the
original workbook, it would save deploying a new workbook.


As I mentioned before, like you I could not uncheck the Forms library,

even
with nothing in the workbook (worksheet controls) or in the VBProject is
associated with the library.

However, the macro I posted does appear to remove the reference. If the
macro is not in the same project, change 'ThisWorkbook' to an appropriate
workbook reference, eg ActiveWorkbook. Of course you need to be sure the
Forms library is not required. Did you try the macro.

The "check" has resulted from Chart plotting in the original workbook,
I think. And then, all the charts are deleted ; and there, unable to
uncheck the Forms Object Library (as much as I could repeat saying
once more over again).


I can't think of any reason Chart plotting, or anything to do with charts,
would add the Forms reference. Are you sometimes exchanging workbooks
between with Excel 97 and a later version. The Forms library is added by
default in XL97 even if not required.

Between XL 97 to 2003 I think (but not certain) there has been one version
change to the Forms library. However I don't recall ever having a

backwards
problem compatibility with this lbrary.

The first thing to find out is why is the Firms ref getting added. With

the
reference checked, press F2. In the Object Browser select MSForms in the

top
combo and look at all the objects listed under Classes for anything that
might exist in your workbook.

Even with the Forms ref, you shouldn't get the 'Type Mismatch', post the
code where you get this. Do you have any other references indicated as
MISSING.

Regards,
Peter T