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: 134
Default Method not run if code after Application.Run

The following code successfully opens a workbook and runs a method in that
workbook

Sub OpenAPS()

Const wb = "C:\Ats\Excel\APS.xls"

Workbooks.Open (wb)

Range("Server").Value = "abc1"

Application.Run ("APS.xls!Sheet4.subscribe")

End Sub


However, if I add more code after the Application.Run line the new code is
not run or, the APS.xls!Sheet4.subscribe method is not fully executed, which
leads to errors.

For example in

Sub OpenAPS()

Const wb = "C:\Ats\Excel\APS.xls"

Workbooks.Open (wb)

Range("Server").Value = "abc1"

Application.Run ("APS.xls!Sheet4.subscribe")

Call GetData

End Sub

The GetData sub is not executed.

The APS.xls!Sheet4.subscribe method takes a few seconds to execute fully.

I don't know if the reason is that the Call GetData is run before the
APS.xls!Sheet4.subscribe is run fully.

If so, how can I force a method to run only after a previous one is exited?

If that is not the reason, what is?

Thanks,

Antonio
 
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
Can the Application.wait method create a pause less than a second? Gum Excel Programming 2 October 3rd 08 01:09 PM
Probelm with Application.Run Method [email protected] Excel Programming 5 August 12th 07 07:29 PM
Help with Application.FileSearch method Roy Harrill Excel Programming 4 August 1st 05 12:56 AM
Excel.Application.Quit() method Mircea Pleteriu Excel Programming 0 March 8th 05 02:39 PM
Application.Run Method Mark Worthington Excel Programming 3 February 4th 04 10:24 PM


All times are GMT +1. The time now is 11:30 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"