Import Excel Table into Drawing using ilogic

Import Excel Table into Drawing using ilogic

Anonymous
Not applicable
877 Views
1 Reply
Message 1 of 2

Import Excel Table into Drawing using ilogic

Anonymous
Not applicable

Hello,

I have been trying to import my excel table in the directory;

C:\Users\tm04.smeric\Desktop\Meric\EXCEL NOZZLE LIST.xlsm

into my drawing, the excel table constantly changes since I have another rule that updates it with the iProperties of the current drawing/project.

If anyone knows how I can implement a rule to import the table that is created on "Sheet1" I'd greatly appreciate it.

 

Thanks in advance

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

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Take a look at this:

AddExcelTable(ExcelFileName As String, PlacementPoint As Point2d, [Title As String], [StartCell As String = "A2"], [ColumnHeaderRow As Long = 1]) As CustomTable

lLike this:

Public Sub CreateDrawingExcelTable()    
    ' Set a reference to the active drawing document
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument
    
    ' Set a reference to the active sheet
    Dim oActiveSheet As Sheet
    Set oActiveSheet = oDrawDoc.ActiveSheet
    
    ' Create the placement point for the table
    Dim oPoint As Point2d
    Set oPoint = ThisApplication.TransientGeometry.CreatePoint2d(25, 25)
    
    ' Create the table by specifying the source Excel file
    ' This assumes that the first row in the Excel sheet specifies the column headers
    ' You can specify a different row using the last argument of the AddExcelTable method
    Dim oExcelTable As CustomTable
    Set oExcelTable = oActiveSheet.CustomTables.AddExcelTable("C:\Temp\test.xls", oPoint, "Excel Table")
End Sub

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes