+ Reply to Thread
Results 1 to 1 of 1

Below CDO macros displays run time error 13

Hybrid View

  1. #1
    Registered User
    Join Date
    01-01-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Wink Below CDO macros displays run time error 13

    I want a macros which can send a email from email client base and i'm using Zimbra, that means not from outlook, and email should be send in html format that is color and font should remain the same which i have in excel, it should pick up the range for eg: c1 to q56 it should copy paste and send it ...
    File attached for your reference..

    Below is the macros which i'm trying, but does not work properly.
    Sub CDO_Send_Selection_Or_Range_Body()
        Dim rng As Range
        Dim iMsg As Object
        Dim iConf As Object
     
        Set iMsg = CreateObject("CDO.Message")
        Set iConf = CreateObject("CDO.Configuration")
     
        ' iConf.Load -1 ' CDO Source Defaults
        ' Set Flds = iConf.Fields
        ' With Flds
        '      .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        '      .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "Fill in your SMTP server here"
        '      .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        '      .Update
        ' End With
     
        Set rng = Sheets("Hourly").Range("c1:q71").SpecialCells(xlCellTypeVisible)
        Set rng = ActiveSheet.Range("c1:q71")
        Set rng = Sheets("hourly").Range("c1:q71")
     
        On Error Resume Next
        Set rng = Sheets("Hourly").Range("c1:q71").Selection.SpecialCells(xlCellTypeVisible)
        On Error GoTo 0
     
        If rng Is Nothing Then
          MsgBox "The selection is not a range or the sheet is protected" & _
                                    vbNewLine & "please correct and try again.", vbOKOnly
          Exit Sub
        End If
     
        With Application
            .EnableEvents = False
            .ScreenUpdating = False
        End With
     
        With iMsg
            Set .Configuration = iConf
            .To = "[email protected]"
            .CC = ""
            .BCC = ""
            .From = """Ashfaq"" <[email protected]>"
            .Subject = "This is a test"
            .HTMLBody = Range("c1:q71")
            .Send
        End With
     
        With Application
            .EnableEvents = True
            .ScreenUpdating = True
        End With
    End Sub
    Last edited by ashfaq sayed; 09-09-2013 at 03:01 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need some macros CDO to send email.
    By ashfaq sayed in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 09-08-2013, 08:06 PM
  2. Send New Email W/ Body of Received Email, Then Delete Sent Email
    By edneal2 in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 07-01-2013, 12:45 AM
  3. I wanna setup excel to send me a email base on cell value....
    By viniche in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-25-2012, 11:19 PM
  4. Sending Email Dependent on Default Email Client
    By Julesdude in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-30-2010, 06:51 AM
  5. Sending email using users preferred email client
    By deadlyduck in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2009, 06:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1