+ Reply to Thread
Results 1 to 27 of 27

Change macro to send as excel file not pdf.

  1. #1
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Change macro to send as excel file not pdf.

    I have the macro below but need it to send the pivot table as an excel file and not a pdf.
    I have searched around but not found any clues. Grateful for any help


    Please Login or Register  to view this content.
    Last edited by And180y; 11-13-2020 at 04:42 PM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,006

    Re: Change macro to send as excel file not pdf.

    .
    http://www.vbaexpress.com/forum/show...able-using-VBA

  3. #3
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Hi Logit,
    not sure what I was doing with the macro in the link but I couldn't get it to work.

    I have managed to cobble together 2 macros and have managed to get it nearly working
    with one flaw, it is sending the whole pivot table rather than just what is relevant to the addressee
    when a is selected as company it should only send the info shown. Currently the addressee can filter
    and see all information. I have attached the parent sheet and an example of what gets sent.
    Grateful for any help.
    Last edited by And180y; 12-05-2020 at 06:59 PM.

  4. #4
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    This solution filters the data page for the company data and creates a workbook based on that filter. It does not use the pivot.


    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Hi Maniacb, thanks for answering and apologies for delay in replying, been a bit under the weather.

    My live sheet pulls the data from a much bigger data set, hence the pivot would the above edit to suit the rows and columns I need?

  6. #6
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    Andy180y, can you restate your question? For clarity sake, I am attaching the file with the code embedded and you'll see that the resultant workbook has the same information as the pivot. Give it a try
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Thanks Maniacb, nearly there, I need to change the columns the macro is picking up data from, is that possible?

  8. #8
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    This line selects the lines to be filtered


    Please Login or Register  to view this content.
    and seen

    Please Login or Register  to view this content.
    I may be able to help if you share a representative sample workbook
    Last edited by maniacb; 12-01-2020 at 06:22 PM.

  9. #9
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Thanks Maniacb, I would need to knock up an anonymous sheet.
    Basically it would filter on the info (company name in column A with info from O,C,N,AC,BC) is that something that would work?

  10. #10
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    it would be a lot straight forward if the info you want shared is in consecutive columns(C,N,O,AC,BC). But yes, it's possible. the code would look like something this:

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Thanks maniacb, I tried changing some of the columns but no matter what I do I get the original output
    from your code above. Can you tell me what I am doing wrong?

  12. #12
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    I think I have made progress, I have linked a new sheet to the columns in my data sheet and now all the columns I need
    are next to one another and in order A to F now.

  13. #13
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    can you share what changes you tried?

  14. #14
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Hi Maniacb I tried changing column letters around.


    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time since the thread has advanced. --6StringJazzer
    Last edited by 6StringJazzer; 12-12-2020 at 08:41 PM.

  15. #15
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Hi Maniacb, thank for the above but still no joy.
    I have constructed a sheet from the actual layout to show you the expected and actual output.
    Not sure where it's going wrong. Thanks for helping me with this.
    Last edited by And180y; 12-05-2020 at 07:00 PM.

  17. #17
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    Here is the updated code section

    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Maniacb thanks so much. Is it possible that a differing version of Excel could be an issue as still not getting the right output?

  19. #19
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    It shouldn't. Here is the working file
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Thanks Maniacb, all looked good on the working file above but when I run the macro I get this error. Attachment 707261
    and it debugs to this line.
    Please Login or Register  to view this content.

  21. #21
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    Updated that line to this

    Please Login or Register  to view this content.
    And added line to clear memory.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  22. #22
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Maniacb, thankyou so much it works perfect. :-)
    Last edited by And180y; 12-05-2020 at 06:58 PM.

  23. #23
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    All working perfect. I've been trying to save this to somewhere other than my flash drive F:\
    Is it possible to save the temp file to my documents on C:\?

  24. #24
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    All you need to do is to replace "F:\" with say "C:\Users\George\Desktop\docs\"

  25. #25
    Forum Contributor
    Join Date
    02-28-2020
    Location
    Inverness, Scotland
    MS-Off Ver
    365
    Posts
    308

    Re: Change macro to send as excel file not pdf.

    Thanks Maniacb, one last query I changed .display to .send thinking it would send the emails without displaying and having to click them
    but it said something about not being defined. Any ideas on that one. Thanks again for help so far. :-)

  26. #26
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    Here is updated code to include a picture instead of an attachment.

    Please Login or Register  to view this content.

  27. #27
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Change macro to send as excel file not pdf.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon (Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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] Send excel file as attachment using gmail in macro?
    By fourmurphys in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-20-2019, 09:21 PM
  2. Need and macro to send a excel file auto
    By amitkr3855 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-02-2013, 12:34 PM
  3. Macro to Send Copy of Excel file to personal email id.
    By VIJEXCEL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2013, 06:02 AM
  4. change event macro to evaluate windows user who initiated the change then send email
    By pmanoloff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2012, 03:31 PM
  5. Newbie question; record macro to send excel file as attacment via lotus
    By kkman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-23-2010, 01:44 PM
  6. How do I change the order of choices in menu File- Send To
    By David McRitchie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 02:05 PM
  7. How do I change the order of choices in menu File- Send To
    By SCPC7018 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  8. How do I change the order of choices in menu File- Send To
    By SCPC7018 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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