+ Reply to Thread
Results 1 to 7 of 7

Help modify macro to save as xlsx instead of pdf

  1. #1
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Help modify macro to save as xlsx instead of pdf

    Hi everyone. I have a spreadsheet that is pretty big, pretty complex, and it is challenging to learn new techniques with it.

    Currently we run the numbers and publish a technician pick sheet in pdf. That sheet only shows what he rates that we have on hand.

    We also publish a sheet specific to that tech showing all the background information not seen by the picker on the warehouse floor in pdf format. That is handy when someone asks a question about that specific date/time/tech.

    And, we publish a stripped down pdf showing what he was owed no matter what was in or out of stock.

    The third out put is what I would like to experiment with. I've googled it. I searched this forum. But, to be honest I am not finding an easy edit that I can understand at my skill level.

    Here is the current macro. The only thing I want to change is that the output file is a workbook I can edit instead of .pdf that gets converted back to excel from time to time. So the Ranges modification and the various calls will have to stay in place. I especially need to keep the filename as shown. P6 is basically "techname & ponumber & "backfill" all concantentated to the cell. This provides a unique and searchable way to quickly get to a specific pick sheet months later. So, if we can't do that then I need to keep what works.

    I'm looking forward to learning a lot of new stuff. Thank you for taking the time to look at this.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Help modify macro to save as xlsx instead of pdf

    Change this:
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.
    This will save to your default directory for Excel.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Re: Help modify macro to save as xlsx instead of pdf

    Thank you! I appreciate it. Apparently it doesn't like something in there. I tried it and got an error message "object doesn't support property or method" so I will be google searching tomorrow.

  4. #4
    Valued Forum Contributor saravnepali's Avatar
    Join Date
    01-14-2019
    Location
    Sydney Australia
    MS-Off Ver
    2010
    Posts
    447

    Re: Help modify macro to save as xlsx instead of pdf

    Please Login or Register  to view this content.
    If you think someone helped you, click on the "* Add Reputation" as a way to say thank you.

    If your problem is solved, go to Thread Tools and select Mark This Thread Solved

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Help modify macro to save as xlsx instead of pdf

    Quote Originally Posted by Mr_Phil View Post
    Thank you! I appreciate it. Apparently it doesn't like something in there. I tried it and got an error message "object doesn't support property or method" so I will be google searching tomorrow.
    Yep, I didn't look very close. Selection won't work there. Should have been
    Please Login or Register  to view this content.
    Regards, JLG

  6. #6
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Re: Help modify macro to save as xlsx instead of pdf

    I’m good sir and I owe it all to you. When I inserted your code and ran it the first time it saved the current worksheet with the correct filename. Taht’s when I realized it was saving the whole sheet which included command buttons, links to external files, dynamic stuff that suddenly had #ref errors, and changing the data source on two pivot tables. I was seriously glad I was working on a sandbox copy instead of the daily driver.

    What that did was make me realize that what I asked for wasn’t really what I was looking for. My three out put files were static snapshots which the export to pdf code did perfectly. The third file needed to be a bare bones editable snapshot. So, I took your code and tried to figure out how to copy, paste only values, then save as a new worksheet. I never did find the answer.

    That led me to adding a helper worksheet. I copied the three columns and pasted values only to it. THAT worksheet is what got copied, named, and pasted as a new workbook.

    I meant to post my code but I also remembered to say thanks while I am away from my PC. I’ll try to remember tomorrow to post the code. Right now I am looking at the select command. I read somewhere that I could tweak the code and speed it up. BUt, for tonight I am up and running. And, I learned a lot that began with the code you helped me with.

    Thank you very much. If you celebrate Christmas I wish you a Merry Christmas and a happy, healthy, and prosperous New Year for you and all of yours. If you done’t celebrate Christmas, I still wish all of that for you.,

  7. #7
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Help modify macro to save as xlsx instead of pdf

    Glad you worked it out and thanks for the reps. Merry Christmas to you as well.
    Regards, JLG

+ 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 workbook as two separate formats (CSV and XLSX) and leave XLSX open
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-04-2019, 07:20 PM
  2. Run macro on several .csv files and save as .xlsx
    By pbd3mon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-03-2015, 11:41 AM
  3. How to save .xlsx file format to .csv by using macro
    By akmughal in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-19-2015, 05:10 PM
  4. [SOLVED] Save macro workbook as xlsx bypassing msg box
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-01-2014, 01:21 PM
  5. Macro Save As .xlsx dialogue box
    By LostInVB in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-02-2013, 10:45 AM
  6. [SOLVED] Macro That will save XLSM as XLSX
    By djfatboyfats in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2013, 08:21 AM
  7. Replies: 6
    Last Post: 08-28-2012, 03:51 AM

Tags for this Thread

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