PDA

View Full Version : Excel/AutoCAD Assistance Needed!



elowther
01-02-2013, 09:37 AM
Hello everyone,

So I am currently trying to figure out how to open an AutoCAD drawing, and then insert it into Excel. I have messed around and tried several different ideas involving saving it as a DXF file, and even as a JPG but I was unable to even insert the drawing as a picture into the file.

Optimistically, I would like to have all this done with excel VBA code so if there is anyone who can help me I would be very appericative!

Thanks
Evan L.

Kenneth Hobs
01-02-2013, 01:43 PM
To insert a picture.
Sub test()
Dim myFiles, e
myFiles = Application.GetOpenFilename(, , , , True)
If Not IsArray(myFiles) Then Exit Sub
For Each e In myFiles
With ActiveSheet
With .Pictures.Insert(e)
.Left = Range("b1").Left
.Top = Range("b1").Top
.Height = Range("a1").Height
.Width = Range("a1").Width
End With
End With
Next
End Sub

RFarah
06-23-2016, 08:17 AM
what if I want to INSERT a cad block (dwg) to AutoCAD by one click of excel button?