Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Probelm with Application.Run Method

Hello,

I'm having difficulty calling a procedure from a separate workbook.
Right now I have

Application.Run "'S-Report.xls'!Time_Phase"

but I'm getting the error message "The macro "'S-Report.xls'!
Time_Phase" cannot be found."

Any ideas?


Thanks,

Calvin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Probelm with Application.Run Method

Is there a macro named Time_Phase in that S-Report.xls workbook's project?

Is s-report.xls open?



wrote:

Hello,

I'm having difficulty calling a procedure from a separate workbook.
Right now I have

Application.Run "'S-Report.xls'!Time_Phase"

but I'm getting the error message "The macro "'S-Report.xls'!
Time_Phase" cannot be found."

Any ideas?

Thanks,

Calvin


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Probelm with Application.Run Method

On Aug 12, 8:57 pm, Dave Peterson wrote:
Is there a macro named Time_Phase in that S-Report.xls workbook's project?

Is s-report.xls open?





wrote:

Hello,


I'm having difficulty calling a procedure from a separate workbook.
Right now I have


Application.Run "'S-Report.xls'!Time_Phase"


but I'm getting the error message "The macro "'S-Report.xls'!
Time_Phase" cannot be found."


Any ideas?


Thanks,


Calvin


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Dave,

I got it to work, I had to use "...Time_Phase.Time_Phase". (My guess
is because both the module and the procedure had the same name.)

I have another question:

The Time_Phase macro begins with a vbYesNo message box. Is it possible
to automatically select "Yes" when calling the Time_Phase macro
externally as I am?

Thanks,

Calvin

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Probelm with Application.Run Method

You need to rewrite the macro to enable the dialog to be skipped. Perhaps
you could add an optional argument which runs the regular way if missing,
and runs without the dialog if present.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


wrote in message
oups.com...
On Aug 12, 8:57 pm, Dave Peterson wrote:
Is there a macro named Time_Phase in that S-Report.xls workbook's
project?

Is s-report.xls open?





wrote:

Hello,


I'm having difficulty calling a procedure from a separate workbook.
Right now I have


Application.Run "'S-Report.xls'!Time_Phase"


but I'm getting the error message "The macro "'S-Report.xls'!
Time_Phase" cannot be found."


Any ideas?


Thanks,


Calvin


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Dave,

I got it to work, I had to use "...Time_Phase.Time_Phase". (My guess
is because both the module and the procedure had the same name.)

I have another question:

The Time_Phase macro begins with a vbYesNo message box. Is it possible
to automatically select "Yes" when calling the Time_Phase macro
externally as I am?

Thanks,

Calvin



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Probelm with Application.Run Method

On Aug 12, 9:24 pm, "Jon Peltier"
wrote:
You need to rewrite the macro to enable the dialog to be skipped. Perhaps
you could add an optional argument which runs the regular way if missing,
and runs without the dialog if present.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______

wrote in message

oups.com...



On Aug 12, 8:57 pm, Dave Peterson wrote:
Is there a macro named Time_Phase in that S-Report.xls workbook's
project?


Is s-report.xls open?


wrote:


Hello,


I'm having difficulty calling a procedure from a separate workbook.
Right now I have


Application.Run "'S-Report.xls'!Time_Phase"


but I'm getting the error message "The macro "'S-Report.xls'!
Time_Phase" cannot be found."


Any ideas?


Thanks,


Calvin


--


Dave Peterson- Hide quoted text -


- Show quoted text -


Dave,


I got it to work, I had to use "...Time_Phase.Time_Phase". (My guess
is because both the module and the procedure had the same name.)


I have another question:


The Time_Phase macro begins with a vbYesNo message box. Is it possible
to automatically select "Yes" when calling the Time_Phase macro
externally as I am?


Thanks,


Calvin- Hide quoted text -


- Show quoted text -


I cannot alter the Time_Phase macro (the one being called externally).
Is there no way to automatically select "Yes" in an externally called
message box?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Probelm with Application.Run Method

Following worked in a light test, but SendKeys can never be considered
reliable -

'should 'click' default button1
Application.SendKeys "{RETURN}"

' otherwise try
' Application.SendKeys "%y"
Application.Run "myBoook.xls!myMacro"

' in myBoook.xls
Sub myMacro()
Dim answer As VbMsgBoxResult

answer = MsgBox("Respond", vbYesNoCancel)

' also try following
' answer = MsgBox("Respond", vbYesNoCancel or vbDefaultButton3)


Select Case answer
Case vbYes
MsgBox "yes"
Case vbCancel
MsgBox "cancel"
Case vbNo
MsgBox "no"
End Select

End Sub

Regards,
Peter T

wrote in message
oups.com...
On Aug 12, 9:24 pm, "Jon Peltier"
wrote:
You need to rewrite the macro to enable the dialog to be skipped.

Perhaps
you could add an optional argument which runs the regular way if

missing,
and runs without the dialog if present.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______

wrote in message

oups.com...



On Aug 12, 8:57 pm, Dave Peterson wrote:
Is there a macro named Time_Phase in that S-Report.xls workbook's
project?


Is s-report.xls open?


wrote:


Hello,


I'm having difficulty calling a procedure from a separate workbook.
Right now I have


Application.Run "'S-Report.xls'!Time_Phase"


but I'm getting the error message "The macro "'S-Report.xls'!
Time_Phase" cannot be found."


Any ideas?


Thanks,


Calvin


--


Dave Peterson- Hide quoted text -


- Show quoted text -


Dave,


I got it to work, I had to use "...Time_Phase.Time_Phase". (My guess
is because both the module and the procedure had the same name.)


I have another question:


The Time_Phase macro begins with a vbYesNo message box. Is it possible
to automatically select "Yes" when calling the Time_Phase macro
externally as I am?


Thanks,


Calvin- Hide quoted text -


- Show quoted text -


I cannot alter the Time_Phase macro (the one being called externally).
Is there no way to automatically select "Yes" in an externally called
message box?



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
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
GetObject method from excel to other application from remote server sandra mangunsong via OfficeKB.com Excel Programming 1 February 24th 05 07:13 PM
Application.Run Method Mark Worthington Excel Programming 3 February 4th 04 10:24 PM
Making VB PasteSpecial method to work the same as Excels Application John[_35_] Excel Programming 1 July 10th 03 05:20 PM


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