Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Ilogic to Copy-Paste Excel Table into Inventor DWG

Anonymous

Ilogic to Copy-Paste Excel Table into Inventor DWG

Anonymous
Not applicable

Hello,

I have created a table in Excel in which the variables will change for every dwg. I've been having trouble trying to figure out how to copy and paste that table into my drawing. The table is in the range (A1:N8). If anyone knows how to do this I'd be glad if you could share it with me.

 

Here's my code so far:

 

Sub Main

Dim xlsxPath As String
xlsxPath = "C:\Users\tm04.smeric\Desktop\Meric\EXCEL NOZZLE LIST.xlsm"

GoExcel.Open(xlsxPath, "Sheet1")


GoExcel.CellValue(xlsxPath, "Sheet1", "A4") = "Link NOZZLE iProp name"
GoExcel.CellValue(xlsxPath, "Sheet1", "B4") = "Enter P value"
GoExcel.CellValue(xlsxPath, "Sheet1", "C4") = "Enter VC value"
GoExcel.CellValue(xlsxPath, "Sheet1", "D4") = "Enter VL value"
GoExcel.CellValue(xlsxPath, "Sheet1", "E4") = "Enter MC value"
GoExcel.CellValue(xlsxPath, "Sheet1", "F4") = "Enter ML value"
GoExcel.CellValue(xlsxPath, "Sheet1", "G4") = "Enter MR value"

GoExcel.DisplayAlerts = False
GoExcel.Save
'GoExcel.Application.visible = True


GoExcel.Close

End Sub

 

0 Likes
Reply
315 Views
1 Reply
Reply (1)

J-Camper
Advisor
Advisor

Try something like this:

Sub Main

Dim xlsxPath As String
xlsxPath = "C:\Users\tm04.smeric\Desktop\Meric\EXCEL NOZZLE LIST.xlsm"

GoExcel.Open(xlsxPath, "Sheet1")

GoExcel.CellValue("A4") = "Link NOZZLE iProp name"
GoExcel.CellValue("B4") = "Enter P value"
GoExcel.CellValue("C4") = "Enter VC value"
GoExcel.CellValue("D4") = "Enter VL value"
GoExcel.CellValue("E4") = "Enter MC value"
GoExcel.CellValue("F4") = "Enter ML value"
GoExcel.CellValue("G4") = "Enter MR value"

'GoExcel.DisplayAlerts = False
GoExcel.Save
'GoExcel.Application.visible = True
GoExcel.Close

End Sub

After "GoExcel.Open" you can reference the cells on that sheet directly.

0 Likes