Oops, I just realised there is a specific place for vba stuff, I have posted that there now, but No idea how to get rid of this, so I'll just mark solved.... *shrug*
Hi there,
I'm not all that fantastic at VBA and most of my work is just Frankenstein'ed,
The idea is that there is a table with a list of staff, and a number generated by a total count of things in another table in their name
If that number is a value above 0, an email is constructed in their name and sent, containing a copy of the table on the "reportlookup" worksheet pasted into the body of the email,
I have two issues...
1. The first email creates fine, opens up and sends etc, but when the loop goes to start again it breaks at the line 'OtlNewMail.HTMLBody = Signature' with a "object variable or with block not set" error and it doesn't continue with the next email and I cannot work out why.
2. I have no idea how to get the table in with its formatting, I figured that it had to be a html call rather than just .body to get the formatting, but from there I'm stuck can I grab it from the clipboard? Because the way that my script currently works, the table on the other sheet is sorted to only show the rows I want in the email, which is a filter on 4 columns which i have in the 'GET TABLE DATA FOR EMAIL section, and then the first 4 columns x all rows inside the table is what I want in the body. but the amount of rows that contains varies quite a lot, so I can't just static reference a range.
I managed to come up with this so far:
Any help would be much appreciated
Thank you very much in advance.
Regards,
Josh
Bookmarks