Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autocad & excel Novice Lee Excel Programming 1 November 12th 08 02:42 PM
AutoCad/Excel SteffenAndreassen Excel Discussion (Misc queries) 6 September 2nd 08 01:02 AM
HOW DO I GET CELL LINES TO NOT PRINT IN AUTOCAD DWG? cadgal Charts and Charting in Excel 2 May 30th 08 06:37 PM
autocad in excel superhumanboy Excel Discussion (Misc queries) 2 February 11th 05 03:41 PM
edit an autocad r14 object to open in autocad 2000 Derek Excel Discussion (Misc queries) 0 January 20th 05 09:51 PM


All times are GMT +1. The time now is 03:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"