+ Reply to Thread
Results 1 to 19 of 19

Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Dear Forum,

    I have received great help from Pike in the quest for Moving Like Sheets from one WorkBook to a Different WorkBook..

    http://www.excelforum.com/excel-prog...haracters.html

    However, I want to create Dynamic Folders and WorkBook(s) in which I can Move these Sheets..These folders also need to be created in the path mentioned in the "Family Date Picker" Sheet..

    I also would appreciate if the Errors occuring incase the Folders Exist an be taken care of..
    Simply OverWriting the Folder woule be fine..!

    The Sheets Moved are moved in the Reverse Order if that can be countered then that would be great as the Family Planning, Individual Plannning WorkSheets add great value when sent to a Client..

    Please Login or Register  to view this content.
    Please find the Attached Sheet for reference..

    Warm Regards
    e4excel
    Attached Files Attached Files
    Last edited by e4excel; 03-25-2011 at 03:05 PM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Hi e4excel

    I like this folder picker event though it a bit old

    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Dear Pike,

    Honestly I am no good in VBA its just that I can understan certain codes..
    I would appreciate if you tell me where do I put these codess like I tried putting all of this in the Module and got an error..

    Missing FOr..

    SO would appreciate if you could add a File or explain where I put the code...

    Warm Regards
    e4excel

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Hi e4excel

    add this code in top of module with code



    Please Login or Register  to view this content.
    and replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Dear Pike,

    I think I am not geting it right..
    Still getting an error..

    So I am attaching my sheet, please make corrections wherever necessary and advise me on the same and also please also upload the corrected file ..

    As I think this would be the last leg of this File..

    Warm Regards
    e4excel
    Attached Files Attached Files

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Hi e4excel,

    Have a look at the attachment
    the best way to learn what the expression do is to highligh them in the module code and press"F1" the editor help has explainations and examples
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Thanks a lot PIke it works really well, but just had to ask you a few questions regarding the Function GetFolderName..

    If I am not mistaken the GetFolderName and the GetPath function are to counter the WorkSheet formulas

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    which are volatile in nature..

    Right..

    I liked the idea of getting a Screen to decide the FOlder Path to store the New WorkBook however can we just have it fixed as it needs to be store at the same place where the "MOving Data XXXX.xlsm" is stored..sp we can freeze it to that..

    Thanks a lot for giving an idea on the HIGHLIGHTING portion as I was not aware of that, that would be helpful in future when doing anything in VBA..

    Thanks a lot..Pike God Bless..just advise on freezing the path..

    Warm Regards
    e4excel.

  8. #8
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Hi e4excel

    Replace all that last code with

    Please Login or Register  to view this content.

  9. #9
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Hi e4excel
    with 2007xl .xlms file try this...

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Wow Pike the last code was the most impressive for me as it was more simple to understand types ..

    Thanks a lot for such a code and it works very well after I just changed the ".xlsm" to ".xls"...

    I think this is good good for me but just incase if you want to check as why I got an error when it was ".xlsm"..

    I got the following error

    Run-time error '1004':

    This extension can not be used with the Seleceted file type. Change the file extension in the File name text box or select a different file type by changing the Save As type..


    That was for FYI..

    SO thanks once again for all your hrlp..

    God bless..!

    War regards
    e4excel

  11. #11
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Dear Pike,

    I have marked the Thread as SOLVED however would appreciate if you could just let me know as to why Im geting an error when its not changed to "xlsm" and even when its changed to ".xls" while closing the newly generated file it gives an indiacation of a difference in format,

    Warm Regards
    e4excel

  12. #12
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Dear Pike,

    I am getting an error in the following line:

    Please Login or Register  to view this content.
    ANd after changing the above to ".xls" I get an error and closing the new WorkBook..

    as follows;=

    The file you are trying to open is in a different format than specified by the file extension.
    Verify that the file is not corrupted and is from a trusted source before opening the file.
    Do you want to open the file now?


    E4excel

  13. #13
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Hi e4excel

    we can go this way

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Thanks for replying Pike,,
    Will get back after testing...

    Regards
    e4excel

  15. #15
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Dear Pike,

    Thanks for the improved version it works really well but I dont understand why it was giving problems when i t had the ".xlsm" extension and what if I wanted it to be saved as ".xlsm".

    I will be distributing these Value WorkBooks to clients with 1997-2003 as well as 2007-2010..

    So hope this works well with different platforms....

    And one more thing..

    DO we require the below mentioned lines of code as when I tried removing the below it still worked..

    Please Login or Register  to view this content.
    Dear Pike, thanks for all the help but Please explain this last bit as the thread is already closed...
    Last edited by e4excel; 03-28-2011 at 02:19 AM.

  16. #16
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    hey e4excel
    No, i can go as it was to do with picking the path
    the fil e format is explained here
    http://www.rondebruin.nl/saveas.htm
    xlnormal i think is xls so you can use it in 2003 or 2007
    clients not good

  17. #17
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Thanks a lot Pike for the link and all your help..
    SO the additional code's not required..
    And finally I conclude that its over now..
    I just realised that the saved file is 97-2003 so good for me..then!

    Thanks a zillion for staying put till the end..

    Warm Regards
    e4excel

  18. #18
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Your welcome

  19. #19
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Creating Dynamic Folders/WorkBook from a Sheet with Dynamic Path.

    Dear Pike

    I will be adding reputation later as I am unable to add reputation now as I have recently added reputation for you on another thread..

    Without Fail .

    Thanks again..!

    God bless!
    Last edited by e4excel; 03-28-2011 at 05:47 AM.

+ 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