iAssembly and Excel Vba code

iAssembly and Excel Vba code

Anonymous
Not applicable
392 Views
2 Replies
Message 1 of 3

iAssembly and Excel Vba code

Anonymous
Not applicable
Hi to all -
I'm sorry for reposting this message.
Last couple days I was trying solve it myself
no lucks - please HELP:

I have a problem in simple code
after creation of assembly file
went to Creation of iAssembly and include/exclude
some parts.
Next step - edit iAssembly via spreadSheet
created two ComboBoxes on sheet2 (sheet1 for Inventor only)
All data on sheet3 - "Data"
Now main part - coding in excell:

Private Sub ComboBox1_Change()
Select Case Sheets("Data").Range("n30")
Case 0: ComboBox2.ListFillRange = "Digit_6"
Case 1: ComboBox2.ListFillRange = "Digit_6a"
Case 2: ComboBox2.ListFillRange = "Digit_6"
Case 3: ComboBox2.ListFillRange = "Digit_6a"

End Select
End Sub

to this point all works OK - Combo box 2 changing its
contents depend of choise in combobox 1.

Afrer saving & exiting Inventor opening the same file
generate an error - see attached pgn.

Please help me - thanks for any ideas
Ursus Uziemblo
0 Likes
393 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Make sure you save and close the excel workbook after making changes in
Excel. The sequence should roughly be the following:

Dim oSheet As WorkSheet
Set oSheet = oFactory.ExcelWorkSheet

' Make changes in Excel sheet
oSheet.Cells(2, 1) = ....

oPartDoc.Update

Dim oWB As workbook
Set oWB = oSheet.Parent

oWB.Save
oWB.Close

oPartDoc.Save
oPartDoc.Close

Sanjay-
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks Sanjay,
I will try your idea - I let you know if its work
Ursus Uziemblo
ps
I'm creating assembly driven by Excel:
from seven pull_down menu user making selection
to create assembly # (A12.321.B).
After exiting assembly updates accordingly
uu
0 Likes