• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Automated Mail using VB

Diablozx

New Member
Hello Pals,

I have created an excel sheet about notification of due date through outlook.

<Refer Attached Sheet>

I am new to VB , and i have tried to some extend. When i tried to run the script it shows error. "
Object variable or With block variable not set " I referred few Online tutorials and still i cant come out the problem.

Can you guys help me to sort of this issue.

 

Attachments

  • Stores_Pending.xlsm
    22.9 KB · Views: 11
Hmm. It appears to run just fine on my machine. I coped the cells down in col H3 down to H6, and the mail macro got called for row 6.
Side note, your macro will go much faster if we limit the number of cells it has to look at. Propose we change the Set Range line to be:
Code:
Set FormulaRange = Me.Range("H3:H500").SpecialCells(xlCellTypeFormulas, xlNumbers)
Now the range only has the cells with formulas that display numbers, as opposed to all the blanks and non-numericals.

When you get the error msg, if there's an option to Debug, please press that and let us know what line the macro is stopped at? Alternatively, you can step through the code 1 line at a time by pressing F8 to try and debug that way.
 
Back
Top