-
Excel VBA - VBA Equivalent of hWnd property
I want to use the About Box API, which requires passing the hWnd of the calling form. In VB6, I would do
Code:
Private Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" _
(ByVal hwnd As Long, ByVal szApp As String, ByVal szOtherStuff As String, _
ByVal hIcon As Long) As Long
Private Sub mnuAbout_Click()
ShellAbout Me.hWnd, "My Program", "Another fine product from HackWare", ByVal 0&
End Sub
I did some Googling, and found what I thought would be the answer in Application.ActiveWindow.Hwnd. However, when I run this, I get an "Object Does Not Support This Property Or Method" run time error.
Code:
ShellAbout Application.ActiveWindow.hwnd, "Main Menu", "Another fine product from HackWare", ByVal 0&
So, for Excel VBA, what would I use as the hWnd of the spreadsheet (no userform in this project).
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
Have you tried this:
Code:
ShellAbout Application.hwnd, "Main Menu", "Another fine product from HackWare", ByVal 0&
-
Ok, that worked, but why did it work?
What is the difference between Application.ActiveWindow.hwnd and Application.hWnd
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
Easy, there is no hwnd property for ActiveWindow
At least according to the Intellisence list.
-
 Originally Posted by Ron Weller
Easy, there is no hwnd property for ActiveWindow
At least according to the Intellisence list.
You are right.
Well, that is the last darn time I'm going to believe something I find on a Google search. 
Thanks again.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
Similar Threads
-
By slimasian in forum .NET
Replies: 0
Last Post: 05-15-2008, 04:24 PM
-
Replies: 146
Last Post: 08-12-2002, 10:40 PM
-
By Rob Teixeira in forum .NET
Replies: 129
Last Post: 06-06-2002, 05:23 AM
-
By Rob Teixeira in forum .NET
Replies: 15
Last Post: 05-31-2002, 03:30 PM
-
By Rattagarn V. in forum VB Classic
Replies: 5
Last Post: 10-09-2000, 07:36 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks