Strange - for me with screenupdating disabled I don't see the file being
opened & closed. But to answer your question I'm pretty sure it's not
possible to print a chart from a closed workbook. In theory you could
extract the chart data from cells from a closed workbook, create a new chart
etc but quite a lot of work.
Try commenting the two select lines which are not necessary.
If needs must you could open your file in a new invisible instance
dim xlApp as excel.application
set xlApp = CreateObject("Excel.application")
Set snagworkbook = xlApp.Workbooks.Open("Snagging List - 1.xls", False,
True)
snagworkbook.Charts("Snag Graph").PrintOut
snagworkbook.Close False
set snagworkbook = Nothing
xlApp.quit
set xlApp = nothing
Regards,
Peter T
"neowok" wrote in
message ...
Is it possible to print a chart which is in another workbook without
opening that other workbook?
at the moment i have
Set snagworkbook = Workbooks.Open("Snagging List - 1.xls", False,
True)
snagworkbook.Charts("Snag Graph").Select
snagworkbook.Charts("Snag Graph").Select
snagworkbook.Charts("Snag Graph").PrintOut
snagworkbook.Close False
this is kinda slow due to the network (im running this macro for 10
files to print 10 graphs), and even though I have
application.screenupdating set to false, you can also still see the
file being opened and closed on the screen.
thanks
--
neowok
------------------------------------------------------------------------
neowok's Profile:
http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=506704