+ Reply to Thread
Results 1 to 3 of 3

Create environment variable

  1. #1
    Registered User
    Join Date
    09-28-2015
    Location
    Cheshire, UK
    MS-Off Ver
    2013
    Posts
    1

    Create environment variable

    Can you help?

    I would like to know how to create, write to and retrieve values from an Environment Variable from within VBA.

    I have code in a shared workbook accessed by several people over Sharepoint and am experiencing some code variable values being overwritten leading to the wrong value being written to the "Masterdata" sheet so am looking to store a certain value "outside" of VBA which I can guarantee belong to the individual user.

    Thanks

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Create environment variable

    I'd suggest you use GetSetting and SaveSetting, which will be stored locally.
    Rory

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Create environment variable

    You could put it in the registry

    https://docs.microsoft.com/en-us/off...ting-statement

    EDIT: Rory beat me to it!

+ 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] Please help - VBA isn't reading my Environment variable
    By Chinoxl in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-16-2020, 03:36 PM
  2. [SOLVED] Finding temp folder. Environment variable?
    By Don Wiss in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-15-2006, 01:10 PM
  3. [SOLVED] Environment Variable Names
    By Chaplain Doug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2006, 10:35 AM
  4. [SOLVED] Can you set a Window's Environment variable in VB
    By Ken Soenen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2006, 02:25 PM
  5. [SOLVED] Environment Variable
    By Andibevan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-03-2005, 11:05 AM
  6. [SOLVED] Using an Array in Environment Variable
    By Jack Gillis in forum Excel General
    Replies: 6
    Last Post: 06-14-2005, 03:05 PM
  7. [SOLVED] Changing an Environment Variable.
    By Jack Gillis in forum Excel General
    Replies: 5
    Last Post: 03-08-2005, 04:06 PM

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