Public variable usage!

A

aiyer

Hi all!

A quick question. I had declared certain variables as public in
*general* module and used them in different macros to create a *.fe
file.

However, I ran the macros once and it ran fine and generated a *.fe
file (let's say c.fev). I close the Excel and open it again to run th
same macros again. But this time, I get the following message quote
C:\Ansys/Model\c.fev!stati not found, where stati is one of the macro
associated with a toolbar button.

Notice that the c.fev was the one created previously and does'nt hav
to be refered any time at all. We r interested in creating more *.fe
file like that each time.

Actually the Excel workbook with all the macros in it is within sa
c:\Ansys\Model. I dunno why Excel is searching the previously create
c.fev when executed the second time.

Is this a bug? Is anything getting corrupted? I would appreciate you
help guys.

Thanks alot.
Arun.....
Vtec Corp
 
P

pikus

Yes it is most definitely a bug. Doesn't sound like anything got
corrupted. The alternating use of foreward and back slashes in the
error message is curious if that is in fact the way it came up. It's
hard to really nail this down given how much I don't know about your
project, but I'd say you should confirm the location and availability
of "stati" in your project. You may have, without realizing it, called
it from a certain workbook or add in that was open the first time you
ran it but is not now. I'd also look at how you're creating/naming the
new .fev files. Also helpful would be to step through your code a line
at a time until the error occurs so you can get a better idea what is
happening at the time. My final recommendation is to post your code or
the workbook itself so we can take a good look... - Pikus
 
C

chris

A macro needs to be in the personal.xls workbook to be accessible to all Excel workbooks. Making a variable Public is irrelevant

----- aiyer > wrote: ----

Hi all

A quick question. I had declared certain variables as public in
*general* module and used them in different macros to create a *.fe
file

However, I ran the macros once and it ran fine and generated a *.fe
file (let's say c.fev). I close the Excel and open it again to run th
same macros again. But this time, I get the following message quote
C:\Ansys/Model\c.fev!stati not found, where stati is one of the macro
associated with a toolbar button.

Notice that the c.fev was the one created previously and does'nt hav
to be refered any time at all. We r interested in creating more *.fe
file like that each time

Actually the Excel workbook with all the macros in it is within sa
c:\Ansys\Model. I dunno why Excel is searching the previously create
c.fev when executed the second time

Is this a bug? Is anything getting corrupted? I would appreciate you
help guys

Thanks alot
Arun....
Vtec Corp
 
C

chris.

Sorry misread your question. But the module with the public variables would still have to be in Personal.xls to be available to all excel workbooks

----- aiyer > wrote: ----

Hi all

A quick question. I had declared certain variables as public in
*general* module and used them in different macros to create a *.fe
file

However, I ran the macros once and it ran fine and generated a *.fe
file (let's say c.fev). I close the Excel and open it again to run th
same macros again. But this time, I get the following message quote
C:\Ansys/Model\c.fev!stati not found, where stati is one of the macro
associated with a toolbar button.

Notice that the c.fev was the one created previously and does'nt hav
to be refered any time at all. We r interested in creating more *.fe
file like that each time

Actually the Excel workbook with all the macros in it is within sa
c:\Ansys\Model. I dunno why Excel is searching the previously create
c.fev when executed the second time

Is this a bug? Is anything getting corrupted? I would appreciate you
help guys

Thanks alot
Arun....
Vtec Corp
 
T

Tom Ogilvy

Sounds like you did a SaveAs of the workbook that contained the stati macro
to create the fev file. Therefore, the onaction property of control was
remapped to the .fev file.
 
Top