PDA

View Full Version : Discussion on Objects



YellowLabPro
05-29-2007, 05:19 AM
I was reading this post, http://vbaexpress.com/forum/showthread.php?t=13041 "Auto Email".

Xld offered a very nice solution in the referenced thread to declare Outlook as an object. That makes sense, its an MS application. But what about declaring AOL or Thunderbird, are these vaild objects?

A question specific to this thread has been circling around in my head for a while now. What can Vba actually declare as an object or another way of putting it is what cannot be declared an object and what are valid/non-valid objects?

So outside of Excel and the MS world what can we declare as objects?
What is or is not an object?

Regards,
YLP

mikerickson
05-29-2007, 07:16 AM
An object is anything that VB can manipulate like it does other objects.

YellowLabPro
05-29-2007, 07:24 AM
Mike,
That helps, and doesn't.... at the same time :rofl: ,:dunno

Is there a list of defined objects that I can get my hands on?
Is there a basis of objects that are intuitive..... like email client instead of Outlook, so AOL or Thunderbird would be objects?

thanks

Jan Karel Pieterse
05-29-2007, 07:54 AM
Basically, any object in any library that you can set a reference to in Tools, references qualifies as a valid object.

As long as the dll (or exe or VBA project or...) in question has a valid object model exposed to VBA you're in business.

So setting an object to Lotus notes is no problem. Provided you have it installed of course...

YellowLabPro
06-03-2007, 04:40 PM
Cross-posted here: http://www.mrexcel.com/board2/viewtopic.php?p=1328040#1328040

I would like to ask a follow up question based on the original one here. America Online is my email default program.
I want to use this program to email worksheets. My code handles all but putting the email address and subject into the email.
Is this possible w/ America Online and if so I will need assistance in accomplishing the task.


Current Code:
ActiveWorkbook.SaveAs Filename:= _
sPath & fname & ".xls"

ActiveWorkbook.SendMail "blahblahblah@aol.com (blahblahblah@aol.com)", "Ecboardco. Orders"
ActiveWorkbook.Close


Thanks,

Doug

Bob Phillips
06-04-2007, 12:50 AM
I don't know the answer Doug because I wouldn't touch AOL with yours, but the principle is that you can only use automation if the other application will behave as an automation server. Outlook, Word et al will all do this (as you would expect as it is an MS concept), and Visio did it even before MS bought it up. If AOL supports automation you will be able to, if not, you won't.

Bob Phillips
06-04-2007, 12:53 AM
I have had a very cursory look, but it doesn't look as though AOL supports automation, but you always have SendMail

See http://www.rondebruin.nl/sendmail.htm for more information on SendMail.

YellowLabPro
06-04-2007, 04:58 AM
Thanks for both answers Bob.
I can't say I blame you for not wanting to touch AOL. I just did a little digging and I could not find a user group for them, so researching the point if they support automation seems highly unlikely if a user forum is not ineffect.

Cheers...
Doug