Consulting

Results 1 to 4 of 4

Thread: Offscreen print

  1. #1
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    4
    Location

    Offscreen print

    Hi everyone

    I have made VBA to take a screenshot of the PrintArea for each of a workbook's 10 worksheets.
    Works fine, but it doesn't work off-screen.*

    Does anyone know a way to take a screenshot of a tab while Application.ScreenUpdating = False ?
    I don't mind if it's a screenshot of a full screen ; it can be cropped to be the Print Area.

    So something like :

    Sub SS()
    Application.ScreenUpdating = False
    Dim oCount as Integer

    Sheets("before.first.tab").Select
    For oCount = 1 to 100
    ActiveSheet.Next.Select
    ActiveSheet.Range("Print.Area").[screenshot code here]
    Next oCount
    End Sub

    Yes, it might be too much for VBA and Windows.
    I gather PrintWindow() can take screenshots of minimized windows, but can't capture areas in an Excel file.


    * If it's off-screen, the whole procedure is 10x faster, and can happen in parallel

  2. #2
    VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,710
    Location
    You might look at the Range.CopyPicture method.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    4
    Location
    Thanks SamT.

    Range.CopyPicture snaps the range into the clipboard. Are you able to save from the Clipboard ? I cannot.

  4. #4
    VBAX Newbie
    Joined
    Jun 2015
    Posts
    4
    Location
    Works a treat once clipboard.dll is registered ; that's what I was missing.

    Much appreciated, SamT.

Tags for this Thread

Posting Permissions

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