+ Reply to Thread
Results 1 to 2 of 2

How to have dynamic Public Const

  1. #1
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    How to have dynamic Public Const

    I understand that the question sounds silly (Const vs. Dynamic).

    Is there any solution for this situation?

    Let us say, I have UserformLogin and ModulePublic :


    Please Login or Register  to view this content.
    If I don't have set temporary value to Username/Password, the ModulePublic cannot compile when opening the workbook.

    But the problem is that, I have already used Public Const statement for Username/Password, then in UserformLogin, I am not able to pass textbox value to Username/Password.

    How to find an alternative solution?

    Thanks.

  2. #2
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    Re: How to have dynamic Public Const

    The reason I would like to put Public Const DatabaseConnectionString As String in ModulePublic is: There are many programs using the string DatabaseConnectionString, so I don't want to repeat the code again and 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. [SOLVED] paste const value
    By surferj24 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-08-2014, 12:17 PM
  2. [SOLVED] Public Const Declaration of Workbooks, Worksheets, Ranges, etc.
    By AlvaroSiza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2013, 03:02 PM
  3. [SOLVED] Defining a dynamic array globally/as public
    By ALN1991 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-09-2013, 11:21 AM
  4. Trying to link a variable to a public const
    By ttd in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-27-2012, 11:44 AM
  5. Can Const be defined once in one Sub?
    By oops in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2007, 04:02 PM
  6. public const
    By jocke in forum Excel General
    Replies: 1
    Last Post: 12-06-2006, 01:17 AM
  7. public const availability?
    By lcoreyl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2006, 11:22 AM

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