Silly Error Question (sub not defined)

Lukums

Board Regular
Joined
Nov 23, 2015
Messages
195
Hello,

Been getting sub or function not defined when using:

Outlook.Application
IsAppRunning

Does anyone have ideas I'm pulling my hair out, chances are it's something in tools/references but I'm confident I have what's required ticked...

Luke
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hello,

Been getting sub or function not defined when using:

Outlook.Application
IsAppRunning

Does anyone have ideas I'm pulling my hair out, chances are it's something in tools/references but I'm confident I have what's required ticked...

Luke

That error usually pops up when VBA is expecting a procedure call but does not recognize whatever appears in the code on the line that is highlighted when you click debug, or it cannot find a macro by the name you have used, like 'IsAppRunning', in the public code modules of the host workbook.
 
Upvote 0
That error usually pops up when VBA is expecting a procedure call but does not recognize whatever appears in the code on the line that is highlighted when you click debug, or it cannot find a macro by the name you have used, like 'IsAppRunning', in the public code modules of the host workbook.

Hello,

I understand that completely.

However this happens for example:

Sub test()

Dim outobj = outlook.application

end sub

Which still generates an error.

It's like it doesn't like these, I've fixed it before but I have no idea what I did or when I did it to reference.
 
Upvote 0
What is the code actually meant to do?

Are you trying to get/create an instance of Outlook?
 
Upvote 0
this might be better
Code:
Dim outobj As Objecdt
Set outobj = CreateObject(outlook.application)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top