Results 1 to 7 of 7

How could I save as pdf and send email

Threaded 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.

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