Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro or Visual Basic doesn't run in background. 2

Status
Not open for further replies.

maxpi

Technical User
Jan 18, 2001
10
0
0
US
I wrote a Visual Basic timer to appactivate Excel and sendkeys f9 to recalculate a spreadsheet every 15 minutes, works ok unless the Excel is 1)minimised 2)I lock the (NT) workstation or 3) I am using another application even though the Excel is not minimised. Is there a way to keep the Excel entirely in the background and get the updates every time Visual Basic times out?

 
You probably won't be able to do this without using the Windows API. One way would be to use the API (not VB) GetFocus function to the the Excel handle (hWnd) then use the API SetFocus function to reset it just before executing the SendKeys function.
 
Can't you do this easiest thru OLE automating excel? John Durbin
john@johndurbin.com
MCP Visual FoxPro
ICQ VFP ActiveList #73897253
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top