Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Running Macro from objApp Application object

SO, if I create an application obhect, objExcelApp
how would I run a macro from the workbook
macro.xls called addnewsheet?

macro.xls!addnewsheet






Sub CreateExcel()
Set objExcelApp = GetObject(,"Excel.Application")
objExcelApp.Visible = True
objExcelApp.Workbooks.Add
End Sub


Lance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Running Macro from objApp Application object

Lance Hoffmeyer wrote:

SO, if I create an application obhect, objExcelApp
how would I run a macro from the workbook
macro.xls called addnewsheet?

macro.xls!addnewsheet






Sub CreateExcel()
Set objExcelApp = GetObject(,"Excel.Application")
objExcelApp.Visible = True
objExcelApp.Workbooks.Add
End Sub


Lance


//this is in C#

objExcelApp.GetType().InvokeMember("Run",
System.Reflection.BindingFlags.Default |
System.Reflection.BindingFlags.InvokeMethod,null, objExcelApp, new
Object[]{ "'macro.xls'!addnewsheet.addnewsheet"});

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
Running a macro from windows application Aerojade Excel Discussion (Misc queries) 1 October 3rd 08 01:19 PM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM
how to get hwnd from application object? Erwin Kalvelagen Excel Programming 2 December 16th 03 07:12 PM
Application Error when running Macro on Workbook open TM[_2_] Excel Programming 1 October 2nd 03 10:53 AM
Application Error when running Macro on Workbook open TM[_2_] Excel Programming 0 September 15th 03 12:33 PM


All times are GMT +1. The time now is 11:39 AM.

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"