![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Forest, VA
Posts: 45
|
Hi,
I have an AddIn that when run, displays a dialog box. This dialog box has a listbox with entries filled in from data stored in a worksheet of the AddIn. I would like for the user to be able to make modifications to this list and so through a multipage form, I have provided a means for the user to do this. It appears to work fine and the new item is shown on the list. But, if the user exists Excel and then restarts or removes and then adds the AddIn, the changes are lost. Is there any way to make those changes permanent for that user? I use the Save method of the workbook with the .xla extension. Thanks for your help, Vlip |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Couldn't you just capture the username via an API call, save his/her info to a text file, and then recall when needed????
I have the API code if you need it. Will have to look [ This Message was edited by: TsTom on 2002-03-22 20:39 ] |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Following is API call for username:
Option Explicit Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _ (ByVal lpBuffer As String, _ nSize As Long) As Long Sub Get_User_Name() Dim lpBuff As String * 25 Dim ret As Long, UserName As String ret = GetUserName(lpBuff, 25) UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1) MsgBox UserName End Sub
__________________
Kind regards, Al Chara |
|
|
|
|
|
#4 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Just have all entries stored on a sheet in the Add-in Workbook and use the "Rowsource" Property to return the list to the user.
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Not sure what the problem is, but I feel is that Excel isn't saving the AddIn when closed.
In the code put a line like ThisWorkbook.Save after the user has made the modifications he needs to do. |
|
|
|
|
|
#6 |
|
New Member
Join Date: Mar 2002
Location: Forest, VA
Posts: 45
|
I do have a line with ThisWorkbook.Save but it isn't saving. That's what the problem is. For some reason, it does not save.
Vlip |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|