Excel

Show Windows "About" dialog

Ease of Use

Easy

Version tested with

2000, 2002 

Submitted by:

Justinlabenne

Description:

Customize and display the Windows About form with your own info. 

Discussion:

This is a simple way to use windows api to show the About form from your own projects. Use it as an information splash-screen of sorts to make you projects appear more professional and to deliver small amounts of author and copyright info to your users. 

Code:

instructions for use

			

Option Explicit 'API declaration for the windows "About" dialog Private Declare Function ShowAbout& Lib "shell32.dll" Alias "ShellAboutA" ( _ ByVal hwnd As Long, _ ByVal szApp As String, _ ByVal szOtherStuff As String, _ ByVal hIcon As Long) Private Declare Function GetActiveWindow& Lib "user32" () Sub ShowAbout_API() ' Constant for your name or company name Const szAuthor As String = " Justin Labenne " ' The workbook's name without the .xls Dim szTitle As String szTitle = Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4) ' Updates copyright info for year created to current year Dim szCopyright As String szCopyright = "?2004-" & Format(Now(), "yyyy") ' Get the window handle Dim lhwnd As Long lhwnd = GetActiveWindow() ' Display the information window Dim lInfo As Long lInfo = ShowAbout(lhwnd, szTitle, vbCr & szAuthor & szCopyright, 0) End Sub

How to use:

  1. Open an Excel Workbook
  2. Copy the code
  3. Press Alt + F11 to open the Visual Basic Editor (VBE)
  4. Select INSERT > MODULE from the menubar
  5. Paste code into the right pane
  6. Press Alt+Q to return to Excel
  7. Save workbook before any other changes
 

Test the code:

  1. Go to TOOLS > MACRO > MACROS
  2. When the dialog appears, select {ShowAbout_API}
  3. Press Run
  4. The Windows about dialog will be shown with the my name and copyright info
 

Sample File:

AboutDialog_API.zip 8.44KB 

Approved by mdmackillop


This entry has been viewed 142 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express