+ Reply to Thread
Results 1 to 5 of 5

MACRO - Save Filename & Location based on Cell value

  1. #1
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    MS365
    Posts
    74

    MACRO - Save Filename & Location based on Cell value

    Hi everyone.

    I have a code here that I've been working on. The problem here is that it always end up in ERROR.

    Here's the code:

    Please Login or Register  to view this content.
    Hope you can help me.
    Last edited by acerlaptop; 02-14-2020 at 05:07 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: MACRO - Save Filename & Location based on Cell value

    what line errors and what is the error?

  3. #3
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    MS365
    Posts
    74

    Re: MACRO - Save Filename & Location based on Cell value

    Quote Originally Posted by davesexcel View Post
    what line errors and what is the error?
    It Says

    Run-time error '1004':

    Document not saved. The document may be open, or an error may have been encountered when saving.

    Then it highlighted:

    Please Login or Register  to view this content.
    It only happened after I added

    Please Login or Register  to view this content.
    on "SaveTo"

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: MACRO - Save Filename & Location based on Cell value

    What is in B20?

    Do you have the PDF opened when running the code?

  5. #5
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    MS365
    Posts
    74

    Re: MACRO - Save Filename & Location based on Cell value

    Quote Originally Posted by davesexcel View Post
    What is in B20?

    Do you have the PDF opened when running the code?
    B20 is a cell that contains values (letters) I want to include in the file location.

    If the value of B20 is "ABCD", then the save location would be H:\TEST\ABCD\

    PDF is closed while running the macro.
    Last edited by acerlaptop; 02-14-2020 at 06:03 AM.

+ 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. Convert sheets to pdf. Filename and location path based on a cell
    By Elainefish in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2019, 01:55 AM
  2. Automate IE11 Save As with save location and filename
    By dband in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2017, 06:11 AM
  3. Save as macro with location and filename
    By realrookie in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-21-2015, 10:16 AM
  4. [SOLVED] Print payslip as pdf and save filename based on a cell value
    By macnabong in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2014, 08:52 AM
  5. [SOLVED] macro to 'save as pdf' that prompts for filename, location AND only prints specified range
    By mtcolombo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2013, 01:49 PM
  6. macro to save sheet from workbook. Specified location and filename
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2011, 11:47 PM
  7. [SOLVED] Macro to Save As with filename based on cell contents.
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2006, 06:10 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