-
Error handling declaring public variables
HI,
I was wondering if I could do some basic error handling before declaring any public variables. I have written some code to create Outlook appoinment items from Excel cell values. It starts off wth declaring the public variables:
Public myOlApp As Outlook.Application
Public myItem As Outlook.AppointmentItem
But to do this the system on which the script runs must have a reference to the Outlook 11.0 object library or the compiler will throw an error message like "User-defined datatype not defined".
Is there anyway to check (and alert the user) wether the library is referenced or not? Moreover, is it possible to reference the library run-time?
-
Have a look at this KB Item. Ignore the zip file (Corrupted)
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules