View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steve JORDI Steve JORDI is offline
external usenet poster
 
Posts: 4
Default [E2007] My VBA turned into an AddIn doesn't see objects

Hi,
Just beginning programming Excel 2007 with VBA.

My application works perfectly as long as it's embedded in my excel
file. This one has "Microsoft Excel Objects" where you can see all the
sheet pages and a "Modules" section where I have my VBA code.

Now I wanted to be able to use my code on each of my Excel files.
So I followed instructions to turn this into an AddIn and install it
in Excel 2007 but the problem is that when launched, the code stops
immediately telling me
Runtime error 424
Object required

Now, it's probably due to the fact that it doesn't see the actual file
objects. I have the feeling it's limited to its own environment, own
space.

To create the Add In, I opened a new empty Excel file, added a Module,
then added my VBA code.
Named the project name: ReadTime.
Saved as an AddIn.
Installed the AddIn in Excel 2007

Of course, when I open a new Excel file and go to the VBA editor, I
can see my worksheet objects, sheets 1 to 8.
Then I see another Project, which has a Module1 with my code, what I
expected to have.

If I step into the code, any reference to the main Excel file objects
leads to an error.
The code executes correctly but doesn't see the objects (sheets 1 to
8). Of course those sheets 1 to 8 objects are not in my "ReadTime"
project, only in the excel workbook itself.

It's surely nothing complex, but I'm missing something to make my
AddIn work in any Excel file.

Thanks for any help on this.

Sincerely,
Steve JORDI

(Remove the K_I_L_LSPAM from my email address)
------------------------------------------------
1197 Prangins Email:
Switzerland WWW:
www.sjordi.com
------------------------------------------------
Volcanoes at www.sjordi.com/volcanoes
MovieDB at www.sjmoviedb.com
------------------------------------------------