'excel file already open' error

'excel file already open' error

Anonymous
Not applicable
418 Views
2 Replies
Message 1 of 3

'excel file already open' error

Anonymous
Not applicable

so I have some iLogic code that is meant to write to an excel file for producing a product catalog for my company. I have used the same block of code with the only change being which excel file it is writing to, for every part in the catalog so far with minmal issues but now I have just one file that gives me a message saying that the excel file is already open and asks if I want to reopen it. I went so far as to add some extra code at the beginning of my rule that closes any open excel files but I still get the popup. I have restarted Inventor, and the whole PC, and gone into task manager to make sure excel is not running in the background and it still gives me the error even the very first time I run the code after turning on the computer and launching Inventor without ever touching excel. help?

0 Likes
419 Views
2 Replies
Replies (2)
Message 2 of 3

AlexFielder
Advisor
Advisor
Can you please share the iLogic you have so far?
0 Likes
Message 3 of 3

Anonymous
Not applicable

SyntaxEditor Code Snippet

InventorVb.DocumentUpdate()

'MessageBox.Show(SheetMetal.FlatExtentsArea, "FlatArea")
'MessageBox.Show(Table_Length, "Notice:")
If Table_Width = 24 Then
	
Select Case Table_Length
Case 12 To 23	: Cell = "B2"
Case 24 To 35	: Cell = "B3"
Case 36 To 47	: Cell = "B4"
Case 48 To 59	: Cell = "B5"
Case 60 To 71	: Cell = "B6"
Case 72 To 83	: Cell = "B7"
Case 84 To 95	: Cell = "B8"
Case 96 To 107	: Cell = "B9"
Case 108 To 119 : Cell = "B10"
Case 120 To 131 : Cell = "B11"
Case 132 To 143 : Cell = "B12"
Case 144	: Cell = "B13"
Case Else	: Cell = ""
End Select

End If

If Table_Width = 30 Then
	
Select Case Table_Length
Case 12 To 23	: Cell = "E2"
Case 24 To 35	: Cell = "E3"
Case 36 To 47	: Cell = "E4"
Case 48 To 59	: Cell = "E5"
Case 60 To 71	: Cell = "E6"
Case 72 To 83	: Cell = "E7"
Case 84 To 95	: Cell = "E8"
Case 96 To 107	: Cell = "E9"
Case 108 To 119 : Cell = "E10"
Case 120 To 131 : Cell = "E11"
Case 132 To 143 : Cell = "E12"
Case 144	: Cell = "E13"
Case Else	: Cell = ""
End Select

End If

If Cell<>"" Then
  fName="3rd Party:Embedding 1"
  GoExcel.Open("Catalog Sheet - Roll Table 1.xlsx", "Sheet3")
  GoExcel.CellValue("Catalog Sheet - Roll Table 1.xlsx", "Sheet3", Cell) = SheetMetal.FlatExtentsArea
  GoExcel.Save : GoExcel.Close

  MessageBox.Show("FlatArea Updated (cell=" & Cell & ")" , "Notice:")
Else
  MessageBox.Show("FlatArea not Updated", "Notice:")
End If
0 Likes