Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 50

Thread: Outlook mail function, protected mode, and opening pdf attachment issues

  1. #1

    Outlook mail function, protected mode, and opening pdf attachment issues



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I will be very grateful for any expert to please kindly help me on the attached document which currently works but with the following issues:

    1. Email sub routine not working. Does not automatically send emails with the attachment to the specified recipients (I.e. admin, the assessor and the assessorís managerís email addresses)
    2. Does not fully execute in protected mode. I need it to always work in protected mode
    3. Does not clear the ligature form (for next use) after completing or executing the processes.
    4. Unable to open the attachment/hyperlinked pdf sent/updated into master sheet (LigMaster).

    Thank you. Your help much appreciated.
    Attached Files Attached Files

  2. #2
    Acolyte jaslake's Avatar
    Join Date
    Aug 2011
    Location
    mineral city oh usa
    Posts
    81
    Articles
    0
    Excel Version
    2007;2010;MAc2011
    Hi mobuk

    Issue 4 appears to be handled by moving lines of Code around. Create the PDF first then create the Hyperlink:
    Code:
    'Sheet14.Hyperlinks.Add Anchor:=Sheet14.Cells(lastRow, 34), Address:=myFile, TextToDisplay:=myFile
    'Create invoice in PDF format
    Sheet1.ExportAsFixedFormat Type:=xlTypePDF, Filename:=myFile
    Sheet14.Hyperlinks.Add Anchor:=Sheet14.Cells(lastRow, 34), Address:=myFile, TextToDisplay:=myFile
    Issue 2: What needs protected...LigatureAssessmentForm?

    I'll look at issues 1 and 3.

    Please understand, this is your project and you know what you wish to do...and why...I have no clue.
    I see what this line of Code is doing. Please explain your INTENTION...why is it doing what it's doing?
    Code:
    ActiveWorkbook.SaveAs "C:\ligatures\" & Sheet1.Range("AB7") & "_" & Sheet1.Range("AB4") & "_" & Sheet1.Range("AE2") & "_" & Format(Now(), "dd-mm-yyyy") & ".xlsx", FileFormat:=51
    John

  3. #3
    Hi jaslake,

    Thanks for the response.

    Issue 4: When I moved the lines of code around as you advised, it did not attach the formatted PDF document to the mastersheet(LigMaster)

    Issue 2: I do protect cells that contain formulas and also those that do not need user inputs. The cells that I do protect are the following but when I do protect, it doesn't function: T2:T7, V3:V7, X2:X7, AB3:AB7, AD2:AD7, S9:AG9, S10:S27, and AA10:AA27.

    FOR THE CODE: ActiveWorkbook.SaveAs "C:\ligatures\" & Sheets("Sheet1").Range("AB7") & "_" & Sheet1.Range("AB4") & "_" & Sheet1.Range("AE2") & "_" & Format(Now(), "dd-mm-yyyy") & ".xlsx", FileFormat:=52
    It is saving the active workbook as C:\ligatures\documentIDnumber_departmentName_locationName_dateOfSubmission. If you click open the ligMaster sheet tab in the attachec document, you will see sample results.

  4. #4
    Acolyte jaslake's Avatar
    Join Date
    Aug 2011
    Location
    mineral city oh usa
    Posts
    81
    Articles
    0
    Excel Version
    2007;2010;MAc2011
    Hi mobuk

    The Code in the attached appears to address all 4 Issues...let me know.

    Please notice the Code in ThisWorkbook Module.
    Attached Files Attached Files
    John

  5. #5
    Hi jaslake,

    Issues 3 and 4 still not resolved.

    Issue 3 : I get the error message 'cannont open the specified file' after clicking on the attached file's link. And then the page 'freezes' - you cannot select other cells on that same page (LigMaster) and cannot move the cursor to left or right.

    Issue 4: After execution, it does not clear the active workbook for next use. BUT when I run the 'Sheet1.ClearLigatureAssessmentForm' macro on its own, it clears the active workbook.

    Also, I got the following error message after execution: 'Document not saved. The document may be open or an error may have been encountered when saving.'

  6. #6
    Acolyte jaslake's Avatar
    Join Date
    Aug 2011
    Location
    mineral city oh usa
    Posts
    81
    Articles
    0
    Excel Version
    2007;2010;MAc2011
    Hi mobuk


    Sorry...don't know what to say. Just ran the Code again on your Sample File in both Excel 2007 and Excel 2010 and received the expected results with no error.

    Are you getting the issues on your Sample File?
    John

  7. #7
    Hi jaslake,

    Thanks a lot. Yes I am getting the issues on my Sample File in Excel 2010.

  8. #8
    Acolyte jaslake's Avatar
    Join Date
    Aug 2011
    Location
    mineral city oh usa
    Posts
    81
    Articles
    0
    Excel Version
    2007;2010;MAc2011
    Hi mobuk

    I simply don't understand. The only thing I can suggest is to upload the offending File and allow me to test the offending File in Excel 2010 on my platform.

    Want to make certain I uploaded the correct File.
    John

  9. #9
    Hi jaslake,

    Thank you so much for this. Please kindly find attached and the results I got are in LigMaster sheet.
    Attached Files Attached Files

  10. #10
    Acolyte jaslake's Avatar
    Join Date
    Aug 2011
    Location
    mineral city oh usa
    Posts
    81
    Articles
    0
    Excel Version
    2007;2010;MAc2011
    Hi mobuk

    Honestly don't know.

    Link to PDF works as expected.
    Clearing of LigatureAssessmentForm works as expected.
    No error messages.

    Ran the Code for times...you may have received emails...didn't see "Send".

    Sorry...simply don't know.
    John

Page 1 of 5 1 2 3 ... LastLast

Posting Permissions

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