ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   WORKBOOK_OPEN event (https://www.excelbanter.com/excel-programming/373355-workbook_open-event.html)

DKS

WORKBOOK_OPEN event
 
Hi,

What could be the possible reasons for a workbook_open event not finding a
user form?

I am running into this situation and just cannot seem to figure out the
reason for such a behaviour.

All help is appreciated.

Tom Ogilvy

WORKBOOK_OPEN event
 
the userform isn't in the same workbook as the workbook with the
workbook_Open event.

--
Regards,
Tom Ogilvy


"DKS" wrote:

Hi,

What could be the possible reasons for a workbook_open event not finding a
user form?

I am running into this situation and just cannot seem to figure out the
reason for such a behaviour.

All help is appreciated.


DKS

WORKBOOK_OPEN event
 
I open only one workbook, the workbook that contains the problematic form.
The WORKBOOK_OPEN event fails; but when I go into the VBA editor via .xls I
see the form.

Thus I believe it cannot be the explanation that you gave?

"Tom Ogilvy" wrote:

the userform isn't in the same workbook as the workbook with the
workbook_Open event.

--
Regards,
Tom Ogilvy


"DKS" wrote:

Hi,

What could be the possible reasons for a workbook_open event not finding a
user form?

I am running into this situation and just cannot seem to figure out the
reason for such a behaviour.

All help is appreciated.


Tom Ogilvy

WORKBOOK_OPEN event
 
It was a question - I left off the ? <g

Is the workbook_open event in the thisworkbook module? It must be.

Is the symptom that the userform doesn't show when you open the workbook
(indicating that the workbook_open event is not firing) or that you get an
error about an undefined object or something like that (indicating the code
ran and the userform was not found)?

--
Regards,
Tom Ogilvy

"DKS" wrote in message
...
I open only one workbook, the workbook that contains the problematic form.
The WORKBOOK_OPEN event fails; but when I go into the VBA editor via .xls
I
see the form.

Thus I believe it cannot be the explanation that you gave?

"Tom Ogilvy" wrote:

the userform isn't in the same workbook as the workbook with the
workbook_Open event.

--
Regards,
Tom Ogilvy


"DKS" wrote:

Hi,

What could be the possible reasons for a workbook_open event not
finding a
user form?

I am running into this situation and just cannot seem to figure out the
reason for such a behaviour.

All help is appreciated.




DKS

WORKBOOK_OPEN event
 
The open event works fine. The module starts working, and it stops at the
first instance where I reference the form. I can see that because when it
stops I go into DEBUG mode to see where the module has problems and it is on
the reference to the form.

The error I get is of type "File not found".




"Tom Ogilvy" wrote:

It was a question - I left off the ? <g

Is the workbook_open event in the thisworkbook module? It must be.

Is the symptom that the userform doesn't show when you open the workbook
(indicating that the workbook_open event is not firing) or that you get an
error about an undefined object or something like that (indicating the code
ran and the userform was not found)?

--
Regards,
Tom Ogilvy

"DKS" wrote in message
...
I open only one workbook, the workbook that contains the problematic form.
The WORKBOOK_OPEN event fails; but when I go into the VBA editor via .xls
I
see the form.

Thus I believe it cannot be the explanation that you gave?

"Tom Ogilvy" wrote:

the userform isn't in the same workbook as the workbook with the
workbook_Open event.

--
Regards,
Tom Ogilvy


"DKS" wrote:

Hi,

What could be the possible reasons for a workbook_open event not
finding a
user form?

I am running into this situation and just cannot seem to figure out the
reason for such a behaviour.

All help is appreciated.





Tom Ogilvy

WORKBOOK_OPEN event
 
try exporting the useform. Delete it. Save the workbook. Close Excel. Open
Excel, open the workbook, Import the userform. Make sure there is a
reference to the MSForms 2.0 library. (in the VBE, tools=References)

--
Regards,
Tom Ogilvy


"DKS" wrote:

The open event works fine. The module starts working, and it stops at the
first instance where I reference the form. I can see that because when it
stops I go into DEBUG mode to see where the module has problems and it is on
the reference to the form.

The error I get is of type "File not found".




"Tom Ogilvy" wrote:

It was a question - I left off the ? <g

Is the workbook_open event in the thisworkbook module? It must be.

Is the symptom that the userform doesn't show when you open the workbook
(indicating that the workbook_open event is not firing) or that you get an
error about an undefined object or something like that (indicating the code
ran and the userform was not found)?

--
Regards,
Tom Ogilvy

"DKS" wrote in message
...
I open only one workbook, the workbook that contains the problematic form.
The WORKBOOK_OPEN event fails; but when I go into the VBA editor via .xls
I
see the form.

Thus I believe it cannot be the explanation that you gave?

"Tom Ogilvy" wrote:

the userform isn't in the same workbook as the workbook with the
workbook_Open event.

--
Regards,
Tom Ogilvy


"DKS" wrote:

Hi,

What could be the possible reasons for a workbook_open event not
finding a
user form?

I am running into this situation and just cannot seem to figure out the
reason for such a behaviour.

All help is appreciated.





DKS

WORKBOOK_OPEN event
 
Tom,

I had already explored the userform export and import option without any
success.

Nevertheless I believe that I have discovered the exact circumstance that
creates the error. You can also reproduce it (unless of course it is a known
problem).

In my userform that I am trying to activate during WORKBOOK_OPEN event, if I
have a field that has its CONTOLSOURCE property set, then .xls crashes. I
would assume that in this case it does not find the sheet concerned and thus
crashes. Strangely it crashes at the first reference of the userform thereby
making me doubt something about userform.

Do you know whether this is a bug or a known constraint that I was unaware
of? If it is a known constraint then how can I get around it other then
explicitly having to write a AFTER_UPDATE event procedure for the field
concerned?

"Tom Ogilvy" wrote:

try exporting the useform. Delete it. Save the workbook. Close Excel. Open
Excel, open the workbook, Import the userform. Make sure there is a
reference to the MSForms 2.0 library. (in the VBE, tools=References)

--
Regards,
Tom Ogilvy


"DKS" wrote:

The open event works fine. The module starts working, and it stops at the
first instance where I reference the form. I can see that because when it
stops I go into DEBUG mode to see where the module has problems and it is on
the reference to the form.

The error I get is of type "File not found".




"Tom Ogilvy" wrote:

It was a question - I left off the ? <g

Is the workbook_open event in the thisworkbook module? It must be.

Is the symptom that the userform doesn't show when you open the workbook
(indicating that the workbook_open event is not firing) or that you get an
error about an undefined object or something like that (indicating the code
ran and the userform was not found)?

--
Regards,
Tom Ogilvy

"DKS" wrote in message
...
I open only one workbook, the workbook that contains the problematic form.
The WORKBOOK_OPEN event fails; but when I go into the VBA editor via .xls
I
see the form.

Thus I believe it cannot be the explanation that you gave?

"Tom Ogilvy" wrote:

the userform isn't in the same workbook as the workbook with the
workbook_Open event.

--
Regards,
Tom Ogilvy


"DKS" wrote:

Hi,

What could be the possible reasons for a workbook_open event not
finding a
user form?

I am running into this situation and just cannot seem to figure out the
reason for such a behaviour.

All help is appreciated.





All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com