+ Reply to Thread
Results 1 to 12 of 12

Print first page of worksheet to email

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    Dundee
    MS-Off Ver
    Excel 2010 64 Bit
    Posts
    15

    Print first page of worksheet to email

    Hi Folks,

    I have a worksheet that contains a template used for printing out in a set layout. The macro I have works fine for printing just the first page of the sheet but I am stumped as to how to send this to an email also. The macros I have come across only deal with worksheet or workbook, not individual pages.

    The reason for wanting to email the as-printed page is that there are headers and footers which i can't capture when setting a normal range.

    Many thanks

  2. #2
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Print first page of worksheet to email

    Hi GFIJame

    Could you upload an example workbook so we could take a look at what you want copyed to e-mail?

  3. #3
    Registered User
    Join Date
    08-17-2012
    Location
    Dundee
    MS-Off Ver
    Excel 2010 64 Bit
    Posts
    15

    Re: Print first page of worksheet to email

    I've attached a mock-up of the template I use in excel 2010 format.

    Thanks for looking stojko

    Template Example.xlsx

  4. #4
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Print first page of worksheet to email

    The range that should be copyed to the e-mail is always A1:I50 ?

  5. #5
    Registered User
    Join Date
    08-17-2012
    Location
    Dundee
    MS-Off Ver
    Excel 2010 64 Bit
    Posts
    15

    Re: Print first page of worksheet to email

    It should always be the first page in its entirety, including header and footer.

  6. #6
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Print first page of worksheet to email

    You know if you want...you can attach this as a .pdf file so no one can change it.

  7. #7
    Registered User
    Join Date
    08-17-2012
    Location
    Dundee
    MS-Off Ver
    Excel 2010 64 Bit
    Posts
    15

    Re: Print first page of worksheet to email

    PDF would be good but it's purely for reference when a PO is generated as the actual details are stored and just fed to the template on creation

  8. #8
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Print first page of worksheet to email

    Here try this example workbook you gave me. Make a folder under "C:\Files"
    Open this workbook and hit Ctrl+Y
    Tell me if it works and if you want it like this? :)

  9. #9
    Registered User
    Join Date
    08-17-2012
    Location
    Dundee
    MS-Off Ver
    Excel 2010 64 Bit
    Posts
    15

    Re: Print first page of worksheet to email

    I am trying to download your example but for some reason it downloads as a php file and not the workbook. Not sure what the issue is.

  10. #10
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Print first page of worksheet to email

    Ok then never mind that
    Open the example you uploaded.
    Insert in Cell "H3": Type anything that could look like a PO numbe like 12312PONUM2012 - doesn't matter what
    then open the VBA Editor and insert a new modul.
    And copy this in the new modul: Then try runing the SendEmail Macro

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-17-2012
    Location
    Dundee
    MS-Off Ver
    Excel 2010 64 Bit
    Posts
    15

    Re: Print first page of worksheet to email

    Works like a charm Thanks kindly for your help, been wracking my brains for a day trying to puzzle it out!

  12. #12
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Print first page of worksheet to email

    Hehe, no problem, Just change the strFileLoc to where you want it to be save and change the strBody to say something if you want.
    Glad I could help.
    bye.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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