+ Reply to Thread
Results 1 to 7 of 7

How could I save as pdf and send email

Hybrid View

john55 How could I save as pdf and... 01-26-2011, 12:31 PM
Leith Ross Re: My excel file file is not... 01-26-2011, 01:41 PM
john55 Re: My excel file file is not... 01-26-2011, 01:53 PM
john55 Re: My excel file file is not... 01-26-2011, 02:51 PM
john55 Re: My excel file file is not... 01-27-2011, 04:09 AM
royUK Re: My excel file file is not... 01-27-2011, 04:32 AM
john55 Re: My excel file file is not... 01-27-2011, 05:13 AM
  1. #1
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    How could I save as pdf and send email

    Hi all,

    I use excel2007 and some users have (probably) an old excel version because they can not read my file sent by email. they see letters, numbers, signs- not my table! Is any way to solve this issue? sholud i change something in the code that i use?
    Thanks a lot for your help.

    this is the code
    Private Sub CommandButton1_Click()
    
        Dim MyArr As Variant
        Dim last As Long
        Dim shname As Long
        Dim a As Integer
        Dim Arr() As String
        Dim N As Integer
        Dim strdate As String
        For a = 1 To 253 Step 3
            If ThisWorkbook.Sheets("mail").Cells(1, a).Value = "" Then Exit Sub
            Application.ScreenUpdating = False
            
            last = ThisWorkbook.Sheets("mail").Cells(Rows.Count, a).End(xlUp).Row
            N = 0
            For shname = 1 To last
                N = N + 1
                ReDim Preserve Arr(1 To N)
                Arr(N) = ThisWorkbook.Sheets("mail").Cells(shname, a).Value
            Next shname
            ThisWorkbook.Worksheets(Arr).Copy
            strdate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss")
            ActiveWorkbook.SaveAs "Part of " & ThisWorkbook.Name _
                                & " " & strdate & ".xls"
                    On Error Resume Next
            With ThisWorkbook.Sheets("mail")
                MyArr = .Range(.Cells(1, a + 1), .Cells(Rows.Count, a + 1).End(xlUp))
             End With
            ActiveWorkbook.SendMail MyArr, ThisWorkbook.Sheets("mail").Cells(1, a + 2).Value
           
            ActiveWorkbook.ChangeFileAccess xlReadOnly
            Kill ActiveWorkbook.FullName
            ActiveWorkbook.Close False
            Application.ScreenUpdating = True
        Next a
    End Sub
    john
    Last edited by john55; 01-27-2011 at 11:44 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: My excel file file is not readable

    Hello John,

    If your recipients have an older version of Excel (pre-2007) and your workbook is saved in 2007 format then they won't be able to read the workbook, unless they have the Office 2007 Converter installed or you save the workbook in 95-2003 format.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: My excel file file is not readable

    Hi Ross,
    thank you for your prompt response. I'm trying to find a solution on my side, should i save my file before sending? i do not want to do it because it takes time, i wanna send the file via excel...is possible to modify the code to save it such as everybody to see the file (old format, pdf)?! i'm very sorry for this question but i do not know how to do it...

    john
    Last edited by john55; 01-26-2011 at 02:16 PM.

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: My excel file file is not readable

    is it easier to add this code to my code for email? ...I use outlook express. could anyone help me, please?
    Private Sub CommandButton3_Click()
    On Error Resume Next
        ChDir "C:\Users\john\Desktop"
        ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
            "C:\Users\john\Desktop\Report.pdf", Quality:=xlQualityStandard _
            , IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
            True
    End Sub
    thanks for your help
    john

  5. #5
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: My excel file file is not readable

    any ideea?
    thank you!

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: My excel file file is not readable

    What's the plan now? Are you planning to convert to pdf?

    I haven't got Outlook express, but maybe a CDO approach will work.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: My excel file file is not readable

    Hi Roy
    Thank you!
    Roy, I think if my sheet is pdf will be readable but i do not know to add this piece of code(for pdf) to my email code.

    john

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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