+ Reply to Thread
Results 1 to 18 of 18

unable to load & save a workbook from a VBA function

  1. #1
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    unable to load & save a workbook from a VBA function

    Here's what I have so far

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by arlu1201; 06-24-2013 at 11:00 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: unable to load & save a workbook from a VBA function

    Please Login or Register  to view this content.
    please check commands sintax on Help, don't create personal commands
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: unable to load & save a workbook from a VBA function

    still doesn't work .... here's what I have now

    Please Login or Register  to view this content.
    thanks
    Last edited by arlu1201; 06-24-2013 at 11:00 AM.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    Where are you trying to use the function?

    If it's on a worksheet then it's not going to work.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: unable to load & save a workbook from a VBA function

    what do I have to do to use this function in a worksheet in one workbook,
    to operate on another workbook ?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: unable to load & save a workbook from a VBA function

    Can you just clarify exactly where you are trying to use the function?

    Are you trying to use it in a cell?

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: unable to load & save a workbook from a VBA function

    why do you use a function and not a sub ? try this
    Please Login or Register  to view this content.
    Last edited by patel45; 06-23-2013 at 10:17 AM.

  8. #8
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: unable to load & save a workbook from a VBA function

    no joy ... here's what I have

    Please Login or Register  to view this content.
    Last edited by arlu1201; 06-24-2013 at 11:00 AM.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: unable to load & save a workbook from a VBA function

    Paul

    Are you going to reveal where you are trying to use this and how it isn't working?

    If you are trying to use it in cell on a worksheet it just isn't going to happen.

    PS Please use code tags when posting code, kind of a rule.

  10. #10
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: unable to load & save a workbook from a VBA function

    in cell H23 Funds.Fidelity
    in cell J23 =LRS(H23)

    in cell H24 Funds.Franklin
    in cell J24 =LRS(H24)

    H columns are either blank or the name of a workbook in the same folder

    does this answer your question ?
    thanks

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: unable to load & save a workbook from a VBA function

    You can't use a user defined function on a worksheet to do what you want.

  12. #12
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: unable to load & save a workbook from a VBA function

    ok ... sigh .
    then how do I do what I want to do ?

  13. #13
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: unable to load & save a workbook from a VBA function

    is there a way for me to load, save selected workbooks in a folder ?
    thanks

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    Yes, but not with a UDF.

  15. #15
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: unable to load & save a workbook from a VBA function

    if not with a UDF, then what can I use ?

  16. #16
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: unable to load & save a workbook from a VBA function

    you can use a sub, as I showed you

  17. #17
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: unable to load & save a workbook from a VBA function

    Paul,

    Welcome to the forum.

    I have added code tags to all your posts. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. In order to put code tags, either type [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] at the end of it, OR you can highlight your code and click the # icon at the top of your post window.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  18. #18
    Registered User
    Join Date
    06-23-2013
    Location
    Elmer, New Jersey, YSA
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: unable to load & save a workbook from a VBA function

    ok ... now using a button to invoke LRS_List() ... making progress, but still doesn't work
    automatic calculations a load time never complete .... see line by line comments
    Please Login or Register  to view this content.
    Last edited by Paul VanLeer; 06-24-2013 at 11:46 AM. Reason: add code tags

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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