+ Reply to Thread
Results 1 to 8 of 8

Save an image file of the print area on each worksheet

  1. #1
    Forum Contributor
    Join Date
    07-18-2014
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    175

    Save an image file of the print area on each worksheet

    I currently have one workbook with about 20 worksheets. Each worksheet has its own data connection to our database.

    I'd like to have a VBA code wrote that refreshes all 20 data connections at once(refresh all), waits until the data is refreshed, then goes through each worksheet(20) and saves the print area of each worksheet as an image file to a specific location as the name of the tab. Pause for 15 minutes, repeats but then replaces the old image file(15 minutes ago) with the new image file in the specific location.

    Thanks for your help!

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Save an image file of the print area on each worksheet

    First of all, I suggest making sure you have background refresh turned off for each of the data connections. Then look up copy as image and your paste options with that. Then instead of trying to do it every 15 minutes in Excel, use the windows task scheduler. You can schedule the task to run every 15 minutes and run your macros. This way the program stops running when it's not working. Also the task scheduler has a lot of built-in flexibility. You can even have it run while you're on vacation and deliver the images to a shared directory.

    There are several ways to schedule a task. I do it on an industrial scale. What I do is create a script in Excel that creates a string you can copy and paste into the task manager. It works like this. The task manager runs the script which opens the target workbook and executes the macro you specified in the script. You can get a copy of a template script and a better explanation here: http://www.utteraccess.com/wiki/inde...a_Macro_to_Run.

  3. #3
    Forum Contributor
    Join Date
    07-18-2014
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    175

    Re: Save an image file of the print area on each worksheet

    Thanks for the reply and sorry for my delay. I'm having a guy look at your suggestion and see if we can make it work. We have mounted TV screens around the shop and wanting to display certain worksheets on each tv depending on the location they are in the shop. 1 TV will (slideshow/display) 3 certain worksheets, while a different tv will (slideshow/display)display 4 different worksheets. All these worksheets will be updated(every 15 minutes) throughout the day so the slideshow will be updated as the worksheets are updated via the data connection. Each separate tv will have its own computer that is accessing updated images from the main computer that has the excel file on it.

    I have a feeling we will be figuring this out for a while before we get this up and running.(ha)

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Save an image file of the print area on each worksheet

    Maybe this will help. It's a watered-down version of something I use. The PP pages is where you define what gets copied to where. You configure this manually.

    Column A (Excel Page) is the page you want to copy from
    Column B (Excel Object) is either the range you want to copy or the object you want to copy. You might want to play with this to get print range
    Column C (Excel Type) is the type of the object: Range or Chart.
    Column D (PP Page) is the power point page on which to place the object.
    Column E (PPObject) is a remark or comment for the benefit of the user - it's not used in the code.
    Column F-I determine where the object is placed on the page.

    I commented out a lot of code that was specific to my application, but left the comments in so you have examples of how to do certain things.

    [Edit] I forgot. You need a template. The template is the powerpoint presentation with the "boiler plate" filled in and everything else blank.
    Attached Files Attached Files
    Last edited by dflak; 02-02-2016 at 12:27 PM.

  5. #5
    Forum Contributor
    Join Date
    07-18-2014
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    175

    Re: Save an image file of the print area on each worksheet

    Thank you for your advice and sample files. We are working on this in the next couple weeks and if I have questions, I'll be in touch.

  6. #6
    Forum Contributor
    Join Date
    07-18-2014
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    175

    Re: Save an image file of the print area on each worksheet

    The data changes ever 15 minutes so we will be republishing every 15 minutes. Will Power Point re-read its data file automatically to capture the changes or do we have to do something in Power Point?

  7. #7
    Forum Contributor
    Join Date
    07-18-2014
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    175

    Re: Save an image file of the print area on each worksheet

    The data changes ever 15 minutes so we will be republishing every 15 minutes. Will Power Point re-read its data file automatically to capture the changes or do we have to do something in Power Point?

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Save an image file of the print area on each worksheet

    You would have to kick off the code that writes the powerpoint. You might have to close the instance of powerpoint and reopen it.

    The way I'd do it is put the spreadsheet in the task scheduler to run a main macro that refreshes the data, then closes the existing instance of powerpoint, then create the new powerpoint from the template. I don't think you can update the powerpoint while it is running due to the file lock. Also I don't know how to detect if there is an instance of powerpoint running and shut it down.

    Maybe this article will help:http://vbadud.blogspot.com/2007/04/g...-check-if.html

    This code should shut it down
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Save selected print area as a pdf file using the text from a specific cells as the file na
    By A440 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2015, 04:14 PM
  2. Macro, to Set Print Area, Save as, Print
    By paul0872829332 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-29-2015, 04:57 AM
  3. Save set print area as PDF
    By benjuk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2015, 07:23 PM
  4. Save Print Area as PDF
    By moosmahna in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2013, 09:29 AM
  5. Print area and save to pdf
    By saniamarco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2013, 05:39 PM
  6. Replies: 1
    Last Post: 01-12-2012, 05:49 AM
  7. How do I get excel 98 to save my set print area?
    By jlpdesign in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-18-2005, 10:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1