How to know which dialog is now active?

basilizak
03-11-2005, 07:48 PM
:confused: :confused: :confused:

italkid
03-11-2005, 10:12 PM
basilizak,

If you expect the best possible help from the other forum members, it might be helpful for them, if you would give us a more discriptive explanation of what exactly you want... :-\

Thanks, and welcome :)

basilizak
03-12-2005, 01:43 AM
i want to make a sofeware to record user 's process in excel, and using another sofeware to simule this process and show to us.
usually , the user do sth from the menu, it can show some dialogs . but i can't record any thing when the dialog is active. so i want to find a way to know which dialog is open , and record it.
thanks.

SubFunction
03-12-2005, 01:57 AM
If you are talking about built-in dialogs, you may want to:

1) define a Public variant to record the active dialog's name

Public strActiveDialog as String


2) whenever a dialog is called, you can in your code do the following:


strActiveDialog = theNameOfDialog



Just a thought of it, this is not a complete answer, as it may seem to you...

basilizak
03-12-2005, 03:04 AM
that can not solute my problem.
1. i don't know the time when the dialog is calling, because , the user control it , not me.
2. some built-in dialogs 's name can find with its commandname, e.g dialogs(i).commandname, but some dialogs , i can find its name, i don't know whether the way is correct, i use ....
for i=1 to 65535
sheets(1).cells(i,1)=dialogs(i).commandname
next
with this , i can find some dialog ,it can show from menu.

SubFunction
03-12-2005, 03:24 AM
that can not solute my problem.
1. i don't know the time when the dialog is calling, because , the user control it , not me.
2. some built-in dialogs 's name can find with its commandname, e.g dialogs(i).commandname, but some dialogs , i can find its name, i don't know whether the way is correct, i use ....
for i=1 to 65535
sheets(1).cells(i,1)=dialogs(i).commandname
next
with this , i can find some dialog ,it can show from menu.

Well, for your concern (1) I would say, yes, the user decides when to call up the dialog in some cases. However, if you are doing things as VBA programmer, you can of course make the recording of the dialog name happen:



strActiveDialog = "somename"
dialogs(x).show ' I don't remember the precise syntax as I don't have Excel at hand. :-(



Actually your concern (2) relates to how to determine the "somename". Of course you can name the dialog at your own discretion if only for the purpose of recording the dialog. For example, you can name the "open file" built-in dialog as

strActiveDialog = "Anyway I know it's a dialog for me to open an file though I don't know what the Microsoft Excel programmers originally name it"

basilizak
03-12-2005, 07:23 AM
i don't know what you said as you don't know what i said.
i want to write a code with VBA like a spy to record any user using my workbook. so i don't know anything the user want to do. i want to know where he is clicking , which menu bar he is choocing , and i want to know which dialog is showing , and the button ,check box ,in this dialog , is using by user.

herilane
03-12-2005, 07:40 AM
That is not doable in VBA.

SubFunction
03-12-2005, 07:46 AM
Basilizak,
If you want to record the movements of the user rather than to know the "result" of the movements and if you want to do it by programming in VBA itself, I would say, it would be quite difficult, if not impossible at all.

:-\

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum