ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to print autocad dwg's from excel vba (https://www.excelbanter.com/excel-programming/442564-how-print-autocad-dwgs-excel-vba.html)

alram

how to print autocad dwg's from excel vba
 
If I have a dwg # in a sheet cell, how can I print that dwg. from excel vba.
This is as far as I got: (I need help with the last 3 lines)

Sub print_dwg_from_excel()
A = ActiveWindow.ActiveCell.Value
B = Dir("c:\AUTOCAD\" & A")
C = "c:\AUTOCAD\" & B
Set fs = CreateObject("SCRIPTING.FILESYSTEMOBJECT")
Set f = fs.GetFile(C)
s = f.PrintOut
End Sub

thanks in advance
Al

GS

how to print autocad dwg's from excel vba
 
alram wrote on 5/13/2010 :
If I have a dwg # in a sheet cell, how can I print that dwg. from excel vba.
This is as far as I got: (I need help with the last 3 lines)

Sub print_dwg_from_excel()
A = ActiveWindow.ActiveCell.Value
B = Dir("c:\AUTOCAD\" & A")
C = "c:\AUTOCAD\" & B
Set fs = CreateObject("SCRIPTING.FILESYSTEMOBJECT")
Set f = fs.GetFile(C)
s = f.PrintOut
End Sub

thanks in advance
Al


I'm curious as to why you think that FSO will open a .dwg file, OR why
you think you can insert a .dwg into Excel. These are native to
AutoCad, which has printing capability built in. They are not image
files and so at best all you'll get is the binary data, if you get
anything at all.

It sounds to me like you have obtained some .dwg files from somewhere
but you don't have access to AutoCad. In this case, try using DWG
Editor. It's free, and lets you do lots of stuff with the dwg! Just
google to find where it can be downloaded.

GS




All times are GMT +1. The time now is 04:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com