Author Topic: Help please with error:10094 ActiveXAutomation: Object var is 'Nothing  (Read 8749 times)

ubacher

  • Oldtimer
  • ****
  • Posts: 2297
I am trying to convert a script from IM3 to IM5.
In IM5 I get the error
10094 ActiveXAutomation: Object var is 'Nothing'

I show the parts of the code which should be of interest here:
The line producing the error is marked.

 
Code: [Select]
Dim catPoP As Category
Dim cur_img As File.
............

Set catPoP = db.Categories("TYPE of FOTO.PartofPano")
...........

For Each cur_img In imgs
 
    AddCat (catPoP,cur_img)

Next
........
Function AddCat (cat As Category, img As File)

If Not cat.HasFile(img) Then    '<<<<<<<<<<<<<<<< This line produces the error
cat.AssignFile img
End If
End Function


Any help is appreciated.


[attachment deleted by admin]

thrinn

  • Hero Member
  • ***
  • Posts: 999
Re: Help please with error:10094 ActiveXAutomation: Object var is 'Nothing
« Reply #1 on: September 22, 2013, 09:45:36 PM »
The error means that cat does not reference a valid object. In your case the category could not be found (in the Set catPoP line).
If I remember correctly, in IMatch 5 you have to use the pipe symbol | instead of the dot notation to specify the full category path.
Try to use
Code: [Select]
Set catPoP = db.Categories("TYPE of FOTO|PartofPano")
Regards,
Thorsten
Thorsten
Win 10 / 64, IMatch 2018, IMA

ubacher

  • Oldtimer
  • ****
  • Posts: 2297
Re: Help please with error:10094 ActiveXAutomation: Object var is 'Nothing
« Reply #2 on: September 23, 2013, 07:59:11 AM »
Thanks, That was it.
( Last night in bed - as I was about to fall asleep - I thought that it has probably something to do with the category not existing or not properly specified)