LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Getting focus back to Excel using Sendkeys statements

Hi,

When I run the following program alone from Excel, it works fine:

Sheets("NEWTSform").Select
Select Case Range("H19").Value
Case 4
Call inputSMIDtonewtsorder
End Select

Select Case Range("H19").Value
Case 3
Call inputSMIEtonewtsorder
End Select


However, when I add this to another program which, again works fine as it
is, the program listed above doesnt run properly it will activate the
Window named in AppActivate, 'Staff Management' , but the Call subroutines
dont run - it just 'freezes'

I add in the following to the end of the previous routine (which works fine
alone) to get the focus back to Excel before running it with:

Appactivate Vantage Interactive Advanced.xls
With ThisWorkbook.Sheets (NEWTSform)

Appactivate Staff Management


Sheets("NEWTSform").Select

Select Case Range("H19").Value
Case 4
Call inputSMIDtonewtsorder
End Select

Select Case Range("H19").Value
Case 3
Call inputSMIEtonewtsorder
End Select

End with

End Sub

It errors here, usually with End sub highlighted with an Expected End with
without with or End Select without Select or something similar!.

Where am I going run it must be possible to do, if they run alone
independently, they should run end-on-end.

Ive tried various combinations of code to reclaim the focus back to
Excel - but it still errors!

Many thanks!
 
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
Excel charts do not update when using SendKeys nandan Charts and Charting in Excel 8 April 9th 07 06:14 PM
How do I sendkeys to Interner Explorer from Excel? els Excel Programming 0 November 15th 05 04:02 AM
sendkeys examples in excel EM3553 Excel Programming 1 September 20th 05 06:27 PM
How Can I Use SendKeys in MAC EXCEL? kenji4861 Excel Programming 1 October 29th 03 07:24 AM


All times are GMT +1. The time now is 10:33 PM.

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

About Us

"It's about Microsoft Excel"