Message 1 of 2
Faulty MS Exсel <-> Inventor Part table

Not applicable
02-23-2012
01:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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