Faulty MS Exсel <-> Inventor Part table

Faulty MS Exсel <-> Inventor Part table

Anonymous
Not applicable
337 Views
1 Reply
Message 1 of 2

Faulty MS Exсel <-> Inventor Part table

Anonymous
Not applicable

Hi, Everyone

 

Please help to localize problem I have on some particular PCs.

 

Problem: none of two actions coded below works.

First action (see line with comment “'change title”) is supposed to rename the title of the most-right column in the Configuration Factory Table.

The next action (just after the line) is supposed to add new column in the Configuration Factory Table.

 

On other PCs the result is «as expected» …on «these» - no results (no errors … nothing).

 

I suspect that some component connecting Inventor and MS Excel is to blame but which and how to fix this?

 

 

Please help.

 

ipartDoc = m_inventorApplication.ActiveDocument

                opartfactory = ipartDoc.ComponentDefinition.iPartFactory

                Dim tcc As Integer = 0

                Dim dRowP As iPartTableRow

                Dim oWorksheet As Excel.Worksheet

 

                dRowP = opartfactory.DefaultRow

                ' save default row

  

                inewColumnIndex = GetColumnIndex(opartfactory, "Title [Summary]")

 

                If inewColumnIndex = -1 Then

 

                    Dim oFactory As iPartFactory

                    oFactory = ipartDoc.ComponentDefinition.iPartFactory

                    oWorksheet = oFactory.ExcelWorkSheet

                    tcc = oFactory.TableColumns.Count + 1

                    Debug.Print(oFactory.TableColumns.Count)

                    oWorksheet.Cells(1, oFactory.TableColumns.Count) = "Changed" 'change title

                    oWorksheet.Cells(1, tcc) = "Title [Summary]"

                    For ir As Integer = 2 To oFactory.TableRows.Count + 1

 

                        oWorksheet.Cells(ir, tcc) = "new"
 

                    Next

 

                    Dim oWorkbook As Excel.Workbook

                    oWorkbook = oWorksheet.Parent

 

                    Dim oXlsApp As Excel.Application

                    oXlsApp = oWorkbook.Parent

 

                    oWorkbook.Save()

                    oWorkbook.Close()

                    oWorksheet = Nothing

                    oWorkbook = Nothing

 

                    Debug.Print(oFactory.TableColumns.Count)

 

 

                End If

            End If

 

 

0 Likes
338 Views
1 Reply
Reply (1)
Message 2 of 2

Dennis.Ossadnik
Autodesk Support
Autodesk Support

Hi maxstel,

maybe this could solve the problem if these PC's are using W7 64-bit with Excel 2010.

http://usa.autodesk.com/getdoc/id=TS14079866

 

regards

Dennis

 



Dennis Ossadnik
Senior Technical Support Specialist
0 Likes