Prev: Median in Excel 2007 pivot-tables
Next: Help on Custom Task Pane in Excel 2007 using Managed code...
From: Dee Sperling on 7 Apr 2010 09:37 I have a macro that asks the user for their name and email address during execution. How can I save this information so that they don't have to reenter it every time they run the macro on a new spreadsheet? There's no point in saving it to the current spreadsheet, as every time they run the macro, it's on a new spreadsheet. Can I store the information to PERSONAL.XLS, then automatically save PERSONAL.XLS so they don't get prompted when closing Excel, and then go get their hat information the next time they run the macro on a new spreadsheet? Thanks! Dee
From: Dave Peterson on 7 Apr 2010 10:08
I don't think you should be touching their personal.xls. In fact, if you tried it with my personal.xls, you'd have to add some more code (mine is marked read-only in windows explorer). And since it's my personal workbook, I update it with changes and it may break your code. You could save the data in a plain old text file (*.txt or *.ini) or you could save the data in the user's registry. Take a look at SaveSetting and GetSetting in VBA's help for sample code. Dee Sperling wrote: > > I have a macro that asks the user for their name and email address during > execution. > > How can I save this information so that they don't have to reenter it every > time they run the macro on a new spreadsheet? There's no point in saving it > to the current spreadsheet, as every time they run the macro, it's on a new > spreadsheet. > > Can I store the information to PERSONAL.XLS, then automatically save > PERSONAL.XLS so they don't get prompted when closing Excel, and then go get > their hat information the next time they run the macro on a new spreadsheet? > > Thanks! > Dee -- Dave Peterson |