Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default calling macro in excel from VB program

I have an excel file opening all the time for getting real time quote
Can I using a VB program to trigger the excel file to run a macro for some other updates?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default calling macro in excel from VB program

On Mon, 19 Jul 2004 03:35:02 -0700, Fung
wrote:

I have an excel file opening all the time for getting real time quote
Can I using a VB program to trigger the excel file to run a macro for
some other updates?


Yes, you can. You need to define an object in the VB program and bind it
to the Excel type library.

Dim objExcel as Object

Set objExcel = New Excel.Application

Then in your code use

objExcel.Run("<Macro Name", [<arg_1,...,<arg_n]) to cause Excel to
trigger the macro (if that syntax doesn't work, try
objExcel.Application.Run...I can't remember which one is correct).

In VBA, simply use Application.Run("<Macro Name", [<arg1,...,<arg_n]

HTH.

--
Rodney S Baker VK5ZTV

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
Pivot Refresh Error when calling Excel Macro from VB.NET program amdefacto Excel Discussion (Misc queries) 0 July 6th 09 10:06 AM
calling a C++ program from Excel 2000 and passing a result from C++ back to an excel spreadsheet ellis kurland Excel Discussion (Misc queries) 3 August 15th 05 04:10 PM
Calling Excel Macro From Vc++ via DDE hari Excel Programming 0 July 6th 04 12:50 PM
Calling Access Program from Excel John Baker Excel Programming 1 April 24th 04 01:20 PM
How disabling sounds when calling a shell program? Michel[_3_] Excel Programming 4 October 22nd 03 09:38 AM


All times are GMT +1. The time now is 06:31 PM.

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"