ThisApplication.ActiveDocument.DisplayName
All --
I have a set of files on my computer that includes
.VB FILE
.IPP FILE
When I run the code within these files on my computer, all is well.
When I run the code within these files on a customer's computer, PREMIER 9.1.4 (same version as mine) displays the following error
ActiveX Automation: Object var is 'Nothing'.
[C:\OPAL IMAGE ANALYSIS PROGRAM\OPAL SEAL V1B\OPAL SEAL PROJECT V1B.ipp>C:\OPAL IMAGE ANALYSIS PROGRAM\OPAL SEAL V1B\OPAL SEAL MODULE V1B.vb|testing#1311] Debug.Print ThisApplication.ActiveDocument.DisplayName
Since the REFERENCES and IMPORTS should be the same because the IPP and VB files are the same, what would keep the CUSTOMER'S COMPUTER from properly handling this the
ThisApplication.ActiveDocument.DisplayName
Thanks.
-- Matt
I have a set of files on my computer that includes
.VB FILE
.IPP FILE
When I run the code within these files on my computer, all is well.
When I run the code within these files on a customer's computer, PREMIER 9.1.4 (same version as mine) displays the following error
ActiveX Automation: Object var is 'Nothing'.
[C:\OPAL IMAGE ANALYSIS PROGRAM\OPAL SEAL V1B\OPAL SEAL PROJECT V1B.ipp>C:\OPAL IMAGE ANALYSIS PROGRAM\OPAL SEAL V1B\OPAL SEAL MODULE V1B.vb|testing#1311] Debug.Print ThisApplication.ActiveDocument.DisplayName
Since the REFERENCES and IMPORTS should be the same because the IPP and VB files are the same, what would keep the CUSTOMER'S COMPUTER from properly handling this the
ThisApplication.ActiveDocument.DisplayName
Thanks.
-- Matt
0
Best Answer
-
Matt,
Is it a run-time error? Can it be that Premier doesn't have any documents opened? That would explain "Object var is 'Nothing'" error as ActiveDocument would be Nothing.
Yuri
0
Answers
-
Yuri --
Thank you for your response.
Looking back through the code to consider your input I found the following code section that tries to activate the ORIGINAL IMAGE if it is already open within PREMIER.Private Function OPAL_ActivateOriginalImage() As Boolean 'Build the DISPLAY NAME for the ORIGINAL IMAGE Dim var1 = Replace (OPAL_OriginalImageFullFileName,OPAL_OriginalImageFolder & "\","") 'Attempt to ACTIVATE the ORIGINAL IMAGE With Application.DocumentCommands.Activate(Nothing) .Run(var1, ThisApplication.ActiveDocument) End With 'If the ACTIVE IMAGE is not the ORIGIONAL IMAGE If (ThisApplication.ActiveDocument.DisplayName <> var1) _ Then 'Then return the appropriate value through the FUNCTION OPAL_ActivateOriginalImage = False Else 'Then return the appropriate value through the FUNCTION OPAL_ActivateOriginalImage = True End If End Function
On my computer, this works fine but on the customer's computer I think the.Run(var1, ThisApplication.ActiveDocument)
is setting theThisApplication.ActiveDocument
to nothing and mangling the flow.
I'll revise this on my machine and then test it on both machines and see if this resolves the issue.
Thanks for pointing me in what I think will be the right direction.
-- Matt
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions