Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Activate Non-Excel Window Through VBA

Hello!

I'd like to activate an Excel window (SAP) through VBA and then use
SendKeys to input the selection criteria for a certain report, and then
run the report. I think this will be easier than explaining how to run
the report.

So, how can I activate the window?

Thanks!
Mark

---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Activate Non-Excel Window Through VBA

Mark,

Try something like the following

Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Declare Function SetForegroundWindow Lib "user32" ( _
ByVal HWnd As Long) As Long


Sub AAA()
Dim HWnd As Long
HWnd = FindWindow(vbNullString, "SAP")
If HWnd Then
SetForegroundWindow HWnd
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com


"Mark Bigelow" wrote in message
...
Hello!

I'd like to activate an Excel window (SAP) through VBA and then use
SendKeys to input the selection criteria for a certain report, and then
run the report. I think this will be easier than explaining how to run
the report.

So, how can I activate the window?

Thanks!
Mark

---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot activate an Addin via the add-ins window in XL 2007 [email protected] Excel Discussion (Misc queries) 0 June 3rd 09 02:41 AM
How to activate (in the Project Explorer window) using VBA EagleOne Excel Discussion (Misc queries) 0 December 15th 06 02:26 AM
In Excel - how to delete new window created from window on tool ba Doug Excel Worksheet Functions 1 April 20th 06 09:22 PM
How do I undo the Excel, Window Menu, New Window command OLDFANG Excel Discussion (Misc queries) 2 March 17th 06 05:31 PM
How to keep window + form activate together John Brash Excel Programming 1 July 24th 03 10:13 AM


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"