Consulting

Results 1 to 15 of 15

Thread: Data persistence without using sheet or external file

  1. #1

    Data persistence without using sheet or external file

    Sorry, wrong section! Could of the mods move it to excel please?

    Hi, I'm looking for a way to save user input during execution of a macro, in such a way that the data is available for the macro in the next session (ie closing and restarting of excel), but isn't stored in an external file or (visibly) on one of the workbook sheets. (also no use of hidden rows etc).

    One way I tought of is to place an embedded object on one of the sheet, make it invisible and somehow store data in it, but I havent found a suitable object yet

    Anyone solved this type of problem before?
    (Im probably just overlooking some really obvious solution or mechanism for this...)

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Quote Originally Posted by splashscreen
    Sorry, wrong section! Could of the mods move it to excel please?

    Hi, I'm looking for a way to save user input during execution of a macro, in such a way that the data is available for the macro in the next session (ie closing and restarting of excel), but isn't stored in an external file or (visibly) on one of the workbook sheets. (also no use of hidden rows etc).

    One way I tought of is to place an embedded object on one of the sheet, make it invisible and somehow store data in it, but I havent found a suitable object yet

    Anyone solved this type of problem before?
    (Im probably just overlooking some really obvious solution or mechanism for this...)
    So you couldn't put it on one of your sheets and format the fonts to white either?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    I could, but I'm looking for a 'clean(er)' solution. Btw, by visibly I mean, maybe its possible to hide a sheet .. but I'd rather not do it like that.

  4. #4
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    You could store values in the registry.

    Take a look at SaveSetting and GetSetting.

  5. #5
    Ok, that could work, though the information can't be shared (its a shared workbook).

  6. #6
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    I think we need some more information.

    What are you actually trying to do?

    Why can't you use an external file or a hidden sheet?

  7. #7
    The reason for these requirements is that I want to have an excelfile with as little 'operational' clutter/constraints as possible (ie no extra files needed to use it, no invisible settings on the sheet that can inadvertently be erased etc).

    The idea is to use a setup that is as robust as possible, so people can freely share it without having to know/worry about breaking underlying code.

    I was hoping excel had some built-in persistent datastore (or some equivalent hack to be possible) that can only be accessed programmatically and not through the usual userinterface (to keep a high degree of seperation between user and code).

    But I think I will go for the Sheet.Visibilty = xlSheetVeryHidden option as this comes close to what Im looking for. Unless someone else has better idea I will set it as solved

    ps i hope im making some sense
    Last edited by splashscreen; 07-26-2005 at 12:29 PM. Reason: ps

  8. #8
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    Would an admin please move this Excel garbage out of our pristine Access forum?

  9. #9
    Would an admin please move this Excel garbage out of our pristine Access forum?
    io!

  10. #10
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    Oh, btw, this wouldn't be hidden, but you could put data in a custom document property for the workbook.

  11. #11
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    Quote Originally Posted by splashscreen
    io!
    I was only kidding.

  12. #12


    ah thx!

    How would this be not hidden for the user?

  13. #13
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    Because you can view it by going to properties on the file menu (from within Excel or Windows Explorer). But it's effectively hidden since no one ever looks at that.

  14. #14
    Many thanks <img>

  15. #15
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    Plz, can an admin move this thread to Excel?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •