call Outlook Procedures from Excel

  • Thread starter Thread starter M Armaghan Khan
  • Start date Start date
M

M Armaghan Khan

i am stuck in calling Outlook procedures in Excel macro how do i call and
which object should i choose to call Outlook Procedures Please Help!!!.
 
Dear sue

thanks for your reply please see below i have mad a program in excel to copy
some file on my desktop and i want to email it to my ID but problem is i m
unable to run outlook procedure within excel macro i have created an object
of Outlook.application but i still don't understand how to call procedure of
Outlook
please see below code on the last line the error occurs it said object
required please tell me what object should i use it will be very helpful .



Sub Copy()


Application.OnTime Now + TimeValue("00:00:15"), "FileCopy1"

Application.OnTime Now + TimeValue("00:00:30"), "FileCopy2"
Dim myOlApp As Object
Dim myOlApp1 As Object

Set myOlApp = CreateObject("Outlook.Application")
project1.Module1.RechargeSending ''error on this line it says object
required
 
So you're trying to call an Outlook VBA procedure from an Excel macro? The
only way that might work -- and it's unsupported -- is if the procedure is a
Public Sub or Function in the ThisOutlookSession module in Outlook VBA. The
syntax for a subroutine would be:

Set myOlApp = CreateObject("Outlook.Application")
myOlApp.MyProcedure

Again, this is an unsupported technique. If it doesn't work, we can't help
you. The alternative, as I'm sure you already know, is to put the code in
Excel VBA instead.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Dear Sue,

i m very thankful to your prompt reply i completed my task on your said
alternative way by putting the code in Excel VBA i realy not have any idea
about it. now my code is working fine Thanks a Lot.

well I love to learn Excel 2007 and outlook 2007 VBA so i can automate all
my tasks so please can you recommend me some great books and websites so i
can increase my knowledge.
 
For Outlook, you might start with the book and web site in my signature below.
 
Back
Top