+ Reply to Thread
Results 1 to 5 of 5

Catching error on Application.GetOpenFilename embed in Open For Input

  1. #1
    Registered User
    Join Date
    02-26-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    5

    Catching error on Application.GetOpenFilename embed in Open For Input

    I would like to do:

    Please Login or Register  to view this content.
    As opposed to:

    Please Login or Register  to view this content.
    Any Help is appreciated.
    Last edited by Clevis; 02-27-2013 at 04:54 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Catching error on Application.GetOpenFilename embed in Open For Input

    Hello Clevis,

    Welcome to the Forum!

    Your desired method violates several VBA syntax rules. Why do you want to change the existing code?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    02-26-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Catching error on Application.GetOpenFilename embed in Open For Input

    Does it matter why? I'm not looking to start a debate on "Why". Just wanted to know if there was a way to do it. With that said:
    1. It's cleaner code.
    2. One less variable to declare.
    3. Less lines of code.
    4. Just to see if it can be done.

    I know the "Open For Input" doesn't have a return value.
    However, the "GetOpenFilename" does.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Catching error on Application.GetOpenFilename embed in Open For Input

    It only matters why to the extent that people typically post here for help in writing better code, not more obscure.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    02-26-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Catching error on Application.GetOpenFilename embed in Open For Input

    Thank you shg,
    Quote Originally Posted by shg View Post
    It only matters why to the extent that people typically post here for help in writing better code, not more obscure.
    I'm a "baseline/noob" Class based programer at best, trying to find my way in this Object based enviroment.
    So, "No" it can't be done; because, the code is to obscure.
    That's ok! I'm moving on to my next hurdle. I will keep my future questions on point.

+ 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