+ Reply to Thread
Results 1 to 8 of 8

VBA code not saving into FilePath

  1. #1
    Registered User
    Join Date
    01-21-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    VBA code not saving into FilePath

    Hi,

    I have this code which basically exports PDF files, which is great. I have been trying to combine a couple of macros to adapt it so that it creates a new folder and saves the pdf files into that new folder. The new folder should be contained within the filepath the current workbook is saved on.

    I think I may have lost the plot somewhere though, as currently this coding is creating a new folder, but saving the pdf's into the same filepath as the original workbook, rather than the new folder created.

    How do I tell it to save them into the folder created?

    Any help greatly appreciated!

    Please Login or Register  to view this content.
    Last edited by Keith Edgar; 01-22-2014 at 08:27 AM.

  2. #2
    Registered User
    Join Date
    01-21-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: VBA code not saving into FilePath

    Didnt realise that, sorry. Have adjusted my original post now

  3. #3
    Forum Contributor
    Join Date
    12-19-2012
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: VBA code not saving into FilePath

    Hi

    Try this
    Please Login or Register  to view this content.
    Regards
    Steve
    Last edited by Steve@Rugby; 01-22-2014 at 10:01 AM. Reason: coment added to code

  4. #4
    Forum Contributor
    Join Date
    12-19-2012
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: VBA code not saving into FilePath

    BTW, a few variables in previous code that i left in as assuming this is only a small part of larger code?

    If not this is the slimmed down version

    Please Login or Register  to view this content.
    Regards
    Steve

  5. #5
    Registered User
    Join Date
    01-21-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: VBA code not saving into FilePath

    Hi Steve,

    Thanks so much, this seems to work. I am hoping to adapt it slightly but I keep getting some errors. Basically for each of the UCase statements, I want to save those worksheets in a different directory.

    So for example, everything is saved under Sourcwb.path & P&L Report, but then for REV > a folder called revenue, for HC a folder called Headcount.... and so on... so that it basically sets up each file in the file path... This is what I have currently...

    Thanks so much for any help...

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    12-19-2012
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: VBA code not saving into FilePath

    Hi kieth,

    Affraid i cant look at this until tommorrow now, hope its not too urgent. Maybe soemmone else can help you tonight if it is.

    Regards
    Steve

  7. #7
    Registered User
    Join Date
    01-21-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: VBA code not saving into FilePath

    Thanks for your help Steve ! really appreciate it.

  8. #8
    Forum Contributor
    Join Date
    12-19-2012
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: VBA code not saving into FilePath

    Hi Keith,

    So sorry for the late reply I was very busy at work. I cant seem to get your code to go wrong in my tests, it seeems to work fine. Could you attach your excel file for us to view and test with?

    Regards
    Steve

+ 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. Replies: 3
    Last Post: 08-07-2013, 10:16 AM
  2. [SOLVED] Including VBA code to copy filepath to cell range
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-18-2012, 07:22 AM
  3. [SOLVED] Copying files from a selected filepath to a filepath mentioned in a worksheet's cell
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2012, 03:59 PM
  4. code for variable filepath
    By jem4614 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2008, 05:15 PM
  5. [SOLVED] Store FilePath Inside Code
    By Magnivy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2006, 05:10 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