Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > How to know which dialog is now active?


Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2005, 07:48 PM
basilizak basilizak is offline
Newcomer
 
Join Date: Feb 2005
Posts: 24
Default How to know which dialog is now active?


Reply With Quote
  #2  
Old 03-11-2005, 10:12 PM
italkid's Avatar
italkid italkid is offline
Down...

Retired Moderator
* Expert *
 
Join Date: Dec 2002
Location: Belgium.
Posts: 6,731
Default

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
Reply With Quote
  #3  
Old 03-12-2005, 01:43 AM
basilizak basilizak is offline
Newcomer
 
Join Date: Feb 2005
Posts: 24
Default

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.
Reply With Quote
  #4  
Old 03-12-2005, 01:57 AM
SubFunction's Avatar
SubFunction SubFunction is offline
Regular
 
Join Date: Feb 2002
Location: Shanghai
Posts: 77
Default

If you are talking about built-in dialogs, you may want to:

1) define a Public variant to record the active dialog's name
Code:
Public strActiveDialog as String

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

Code:
strActiveDialog = theNameOfDialog

Just a thought of it, this is not a complete answer, as it may seem to you...
__________________
I don't read. I just think.

Last edited by SubFunction; 03-12-2005 at 02:21 AM.
Reply With Quote
  #5  
Old 03-12-2005, 03:04 AM
basilizak basilizak is offline
Newcomer
 
Join Date: Feb 2005
Posts: 24
Default

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.
Reply With Quote
  #6  
Old 03-12-2005, 03:24 AM
SubFunction's Avatar
SubFunction SubFunction is offline
Regular
 
Join Date: Feb 2002
Location: Shanghai
Posts: 77
Default

Quote:
Originally Posted by basilizak
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:

Code:
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"
__________________
I don't read. I just think.
Reply With Quote
  #7  
Old 03-12-2005, 07:23 AM
basilizak basilizak is offline
Newcomer
 
Join Date: Feb 2005
Posts: 24
Default

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.
Reply With Quote
  #8  
Old 03-12-2005, 07:40 AM
herilane's Avatar
herilane herilane is offline
Unashamed geek

Retired Moderator
* Expert *
 
Join Date: Jul 2003
Location: London, England
Posts: 8,988
Default

That is not doable in VBA.
Reply With Quote
  #9  
Old 03-12-2005, 07:46 AM
SubFunction's Avatar
SubFunction SubFunction is offline
Regular
 
Join Date: Feb 2002
Location: Shanghai
Posts: 77
Default

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.

__________________
I don't read. I just think.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->