Problem with GoExcel.FindRow

Problem with GoExcel.FindRow

Anonymous
Not applicable
6,998 Views
23 Replies
Message 1 of 24

Problem with GoExcel.FindRow

Anonymous
Not applicable

Can't I really can't figure it out...

 

I made a code that goes and look in an excel file. It finds the Stock Number in the column Stock_Number and adds the description of said material from the column Description_Materiau. (I joined the .xlsx file)

 

We have three computer working on drawings on the same server and this code works on 2 out of 3 computer.

 

The first error that pops up on the computer is: 

Error in rule: DescriptionMateriau_iproperty_test, in document: TUNNEL.ipt

Exception from HRESULT: 0x800A03EC

 

and when you run the rule again it's:

GoExcel: Could not match the column title: "Stock_Number".

 

But if I paste the path of the .xlsx (the one used in the code) in the windows explorer of said computer, it will open. So the computer knows where to find the file and has access to it.

 

Here's the code:

SyntaxEditor Code Snippet

'set the target document
oDoc = ThisApplication.ActiveEditDocument

'Run juste si c'est un .ipt
If oDoc.DocumentType = kPartDocumentObject Then

    Dim propertyName As String = "Description_Materiau"
    Dim propertyValue As String = "Description Materiau"
    customPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")
    Try
    oProp = iProperties.Value("Custom",propertyName)
    Catch
    ' Assume error means not found
    customPropertySet.Add("", propertyName)
    iProperties.Value("Custom", propertyName) = propertyValue
    End Try
    
    Dim oPropSet2 As PropertySet
    oPropSet2 = oDoc.PropertySets.Item("Design Tracking Properties")
    SN = oPropSet2.Item("Stock Number").Value
    
    If SN = Nothing Then
    
        MessageBox.Show("Le num�ro de mat�riel n'est pas entr�", "Stock Number non-entr�")
        
    Else
        
        GoExcel.Open("\\192.168.7.10\dessins$\Inventor\iLogic\Liste_materiau.xlsx","Feuil1")
        GoExcel.TitleRow = 1
        
        'compare excel data
        If GoExcel.FindRow("\\192.168.7.10\dessins$\Inventor\iLogic\Liste_materiau.xlsx", "Feuil1", "Stock_Number", "=", SN)
        
            ' Get a reference to the PropertySets
            ' we're really only using Design Tracking Properties in this case though
            Dim oPropSet1 As PropertySet
            oPropSet1 = oDoc.PropertySets.Item("Inventor Summary Information")
            Dim oPropSet3 As PropertySet
            oPropSet3 = oDoc.PropertySets.Item("Inventor User Defined Properties")
            
            'set value to excel data
            iProperties.Value("Custom", propertyName) = GoExcel.CurrentRowValue(propertyName)
        
        'This last part doesn't work. It will put the description of row 2 if it does find the Stock Number in the list 
'Ne marche pas... Pourquoi? Else MessageBox.Show("Le num�ro de mat�riel n'existe pas dans la liste Excel. Ajouter le num�ro de mat�riel dans la liste ainsi que sa description et r�essayer.", "Description non-trouv�e") End If End If End If

 

0 Likes
Accepted solutions (2)
6,999 Views
23 Replies
Replies (23)
Message 21 of 24

MjDeck
Autodesk
Autodesk

Please try this attached patch DLL. Test it with the GoExcel rule on the computer that has the problem. It should work on any computer that has Inventor 2107 build 199.

- close Inventor
- make a backup copy of the file Autodesk.iLogic.Core.dll in the folder %ProgramFiles%\Autodesk\Inventor 2017\Bin

- unzip the attached ZIP

- rename the file Autodesk.iLogic.Core.dll_patch to Autodesk.iLogic.Core.dll

- copy the file to %ProgramFiles%\Autodesk\Inventor 2017\Bin


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 22 of 24

Anonymous
Not applicable

I'll test this on monday Mj! 

0 Likes
Message 23 of 24

Anonymous
Not applicable

The patch doesn't work Mj. Still get the same error as I did when trying to use GoExcel.

0 Likes
Message 24 of 24

MjDeck
Autodesk
Autodesk

Ok, thanks. I've got another idea. I'll try to post another patch soon.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes