print a chart in another workbook without opening the workbook?

N

neowok

Is it possible to print a chart which is in another workbook withou
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 1
files to print 10 graphs), and even though I hav
application.screenupdating set to false, you can also still see th
file being opened and closed on the screen.

thank
 
P

Peter T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top