Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Call Excel Macro from Outlook

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sjstewart1981@yahoo.co.uk - 21 Nov 2007 20:57 GMT
Hi
How do you call an excel macro from Outlook? I have an excel macro
that relies on an email I get everyday, so I have a macro in Outlook
that copies the excel attachment to a certain folder. I would then
like that macro to open up a workbook in Excel that has my macro in
and autorun it without me having to open it manually. Is this
possible?

Thanks,
Simon
Charles Chickering - 21 Nov 2007 21:38 GMT
Simon, try something like this:
Sub CallExcelMacro()
Dim eApp As Excel.Application
'Note: Must have set reference to:
'Microsoft Excel 11.0 Object Library
'This is accessed in the VBE Editor
'Under Tools -> References...
   Set eApp = GetObject(,"Excel.Application") 'Assumes Excel is open,
       'Use CreateObject if Excel is not open.
   eApp.Run "HelloWorld" 'Runs the subroutine name "HelloWorld"
End Sub

Let me know if you have problems.
   
Signature

Charles Chickering

"A good example is twice the value of good advice."

> Hi
> How do you call an excel macro from Outlook? I have an excel macro
[quoted text clipped - 6 lines]
> Thanks,
> Simon
sjstewart1981@yahoo.co.uk - 22 Nov 2007 18:43 GMT
Brilliant thanks Charles, I will try it out and let you know how i get
on! Simon
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.