VBA Excel/Outlook/Powerpoint Integration assignment.

Posted 16 December 2013 - 11:56 AM

Good Afternoon everyone, I am stuck on an assignment and I was wondering if anyone could point out what exactly is going wrong.

here is the assignment:

3. Start Excel, open Assign_15_Excel_Loans, and activate VBA (Alt-F11).
4. Add code to the Letters macro to do the following:
a. In Outlook, create a Drafts folder with a name equal to the name of the “Loans” worksheet.
i. Before actually creating the folder, check if a Drafts folder by the same name already exists and, if it does, issue a message and exit the procedure.
b. For each loan on the Loans sheet, create an email with the following specifications:
i. Subject set to the word “Loan” followed by the Loan #.
ii. To set to the Last Name followed by “@RingDing.com”.
iii. Body set to “Please see attached.”.
iv. Attachments set to the letter that was created and saved for the loan.
v. Move the email to the Drafts folder that was just created.
c. When done with all loans on the Loans sheet, open the Assign_15_Power_Loan_Stats presentation and add a slide to the end with the following specifications:
i. Slide layout of “Title Only”.
ii. Set the text of the title to be equal to the name of the “Loans” worksheet.
iii. In Excel, create a Bar Chart showing the Number of Loans that were Approved and Rejected then cut and paste this Bar Chart as a Shape onto the new slide.
1. Reduce the size (Width & Height) of the Bar Chart Shape by 70%.
2. Set the location (Left & Top) of the Bar Chart Shape to be 70 and 200, respectively.
iv. In Excel, create a Column Chart showing the Amount of Loans that were Approved and Rejected then cut and paste this Column Chart as a Shape onto the new slide.
1. Reduce the size (Width & Height) of the Column Chart Shape by 70%.
2. Set the location (Left & Top) of the Column Chart Shape to be 370 and 200, respectively.
d. Save and close the presentation.
e. Close PowerPoint and free up the
PowerPoint Application object.

Here is my code so far. Please note that I have not finished the the bar chart things as I would like to get my current issues sorted out before I attempt to go any farther. I get an error saying that the folder cannot be created in outlook.