+ Reply to Thread
Results 1 to 6 of 6

How might one "save" a PSWD in a macro temporarily.

  1. #1
    Registered User
    Join Date
    05-14-2007
    Posts
    8

    How might one "save" a PSWD in a macro temporarily.

    How/where might one save a USERID & PSWD that is entered via an input box upon the opening of an EXCEL spreadsheet so that one doesn't need to re-enter the same information every time one executes a new macro in that spreadsheet, but making sure that information does disappear when the spreadsheet is saved.

    Storing the information in the spreadsheet itself was the first idea, and one can tell a macro to clear that information out upon closing the spreadsheet. The problem is that if one just saves a copy of the spreadsheet rather than closes it, the sensitive information is not cleared out. Saving files containing user/ID and PSWD, however protected or encrypted, violates our company security policy.

    Can you make parameters persist somewhere in memory between executions of a macro where that information can be re-accessed by each macro when it is executed, and cleared out when the spreadsheet is saved or closed?

    Help!

  2. #2
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    Try this in the Workbook event:
    Please Login or Register  to view this content.
    Where "A1" represents the cell you stored the password in.

  3. #3
    Registered User
    Join Date
    05-14-2007
    Posts
    8

    Sorry. Tried that.

    Whoops! My mistake. I didn't read your solution very carefully. Looks like it may work. Thanks!
    Last edited by ldevrries; 08-30-2007 at 05:13 PM.

  4. #4
    Forum Contributor
    Join Date
    07-05-2007
    Location
    Lexington, MA
    Posts
    302

    Global parameters during an Excel session

    Consider the following VBA fragment, which I just typed in, so there may be typos. The global variable holds its value during the current Excel session, in memory only, and not in the workbook.
    Please Login or Register  to view this content.
    FrankBoston is the pen name for Andrew Garland, Lexington MA

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    Excel is a far from secure environment. not sure why you need this, but take a look at Protection with UserInterFace Only. This allows macros to be used on sheets without constantly removing the password.

    http://www.excel-it.com/vba_examples.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Forum Contributor
    Join Date
    09-04-2006
    Location
    Yorkshire, England
    Posts
    267
    Excels security is a joke.

    Any worksheet password can be broken in under 30 seconds - ive seen it. a macro break that break the most obscure passwords you can imagine.

    Anyway

    However you could build into the macro, a code that regonises your username. you could use something like the below

    Please Login or Register  to view this content.
    JR
    Versions
    Mac OS X 'Leopard'
    Mac MS Office Excel 2004
    Windows XP
    MS Excel 2002
    MS Excel 2003

+ 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