ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automation Error(-2147467259) in Properties Collection (https://www.excelbanter.com/excel-programming/327439-re-automation-error-2147467259-properties-collection.html)

Bob Phillips[_6_]

Automation Error(-2147467259) in Properties Collection
 
This is odd.

I ran the code, and as you say, I get the error.

If I then access the forms properties in the watch window, I can then run
the code fine. Change the property, and it won't run again.

No answers, yet, but I will dig around.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"VJ" wrote in message
...
Can somebody suggest me why I am getting "Unspecified Error" when the
following line of code executes.

Debug.Print

Application.Workbooks("WBName.xlt").VBProject.VBCo mponents.Item("FormName").
Properties.Item("ShowModal").Value

Before opening the workbook, I am unlocking it which is working fine but

for
some reason I am not able to get reference to the Properties collection.

It
works fine sometimes when I run in the debug mode.

Help would be appreciated.

Thanks,





Bob Phillips[_6_]

Automation Error(-2147467259) in Properties Collection
 
It makes no difference Simon if you use the index number, i.e. it is not
ShowModal that is the problem, but Properties collection (or at least where
it shows).

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Simon Murphy" wrote in message
...
VJ
Just guessing but...
the showmodal property is not in the object model for forms (in XP), it is

a
parameter of the show method. So I wonder if it does not exist (publicly)
until a form is shown.
As you say the code works fine if the form window is open, but not
otherwise. this is a bit like how you have to select a sheet before you

can
select a range on it.

Sorry I cant be more help
What are you wanting to do? maybe there is another way?

cheers
Simon
"VJ" wrote:

I would really appreciate your help if you can dig out the answer

because I
have used all my resources and energy to find the answer but no luck.

Regards,

"Bob Phillips" wrote:

This is odd.

I ran the code, and as you say, I get the error.

If I then access the forms properties in the watch window, I can then

run
the code fine. Change the property, and it won't run again.

No answers, yet, but I will dig around.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"VJ" wrote in message
...
Can somebody suggest me why I am getting "Unspecified Error" when

the
following line of code executes.

Debug.Print


Application.Workbooks("WBName.xlt").VBProject.VBCo mponents.Item("FormName").
Properties.Item("ShowModal").Value

Before opening the workbook, I am unlocking it which is working fine

but
for
some reason I am not able to get reference to the Properties

collection.
It
works fine sometimes when I run in the debug mode.

Help would be appreciated.

Thanks,









All times are GMT +1. The time now is 12:29 PM.

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