+ Reply to Thread
Results 1 to 4 of 4

Excel VBA 2010 - Is it possible to have an input box write an Option Explicit?

  1. #1
    Registered User
    Join Date
    11-26-2015
    Location
    Tampa, FL - US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Excel VBA 2010 - Is it possible to have an input box write an Option Explicit?

    New to VBA and programming.

    I'm trying to write a program where it asks the user for a location of certain files. I would like the drive and path to be an Option Explicit statement that is referenced later in the program in multiple places. Don't quite know if this is even possible? If not, any suggestions? Thanks in advance.

  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,259

    Re: Excel VBA 2010 - Is it possible to have an input box write an Option Explicit?

    Hello b4tmast,

    Option Explicit is a module level statement used to force explicit declaration of all variables in that module. This has no influence on an InputBox.

    If you have code written, you should post it. Providing both before and after examples of what you want to do will help get you the answers you need.
    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
    11-26-2015
    Location
    Tampa, FL - US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Excel VBA 2010 - Is it possible to have an input box write an Option Explicit?

    My apologies... This is what I was thinking about. Not sure about the syntax:

    Please Login or Register  to view this content.
    Is that syntax correct? I understand that an Option Explicit must be at the beginning of each module (do I repeat the same thing there?). But, what about for each Worksheet? Does the Dim cover all the sheets in the Workbook as well? Am I understanding this correctly?

  4. #4
    Registered User
    Join Date
    11-26-2015
    Location
    Tampa, FL - US
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Excel VBA 2010 - Is it possible to have an input box write an Option Explicit?

    Thanks for your answer. I understand now. I've other questions, but, feel that they should be new threads. Thanks again.

+ 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. Option Explicit
    By Marianus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2013, 05:01 AM
  2. Dim in Option Explicit
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 03-22-2011, 03:47 PM
  3. Option Explicit and Dim ds as what?
    By leaning in forum Excel General
    Replies: 3
    Last Post: 10-20-2010, 03:50 PM
  4. When beginning a Macro, what happens if you write Option Explicit at the top?
    By larryg003 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2010, 08:00 PM
  5. Option explicit
    By Alexandre Brisebois (www.pointnetsolutions.com) in forum Excel General
    Replies: 1
    Last Post: 07-25-2005, 12:05 PM
  6. Option Explicit
    By Piranha in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-05-2005, 11:18 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