VBA and loading forms (Excel 2002)

  • Thread starter Thread starter Andy C
  • Start date Start date
A

Andy C

Hi,

This has probably been asked before but I can't find it.

When I load a workbook in VBA using:

Dim wb As Workbook
Dim ws As Worksheet

Set wb= Workbooks.Open(filename, False, False)
Set ws= wb.Sheets(1)

None of the command buttons on the called worksheet or UserForms in the
called workbook are available to me. I can't access them and they don't
appear in the Project Explorer. How can I get round this and be able to
access the forms and command buttons in the called workbook when loaded?

Thanks,

Andy C
 
I wonder what the setting is for Automation security on your system. I've
not used 2002 with VBA, so don't know if it's similar to 2003/2007 or not.

HTH,
Barb Reinhardt
 
That's what I was asking. You are opening the file as read only. What
happens if you don't do that?
 
There's no difference. There's still no buttons on the opened worksheet and
the form doesn't appear in the solution explorer.
 
Yes, the buttons are there and the form appears in solution explorer (and the
buttons display it OK as they are supoosed to).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top