+ Reply to Thread
Results 1 to 3 of 3

Lotus email attachment doesn't show Excel formula

  1. #1
    Registered User
    Join Date
    01-13-2009
    Location
    Washington, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Lotus email attachment doesn't show Excel formula

    I am sending out emails (Lotus 8.5.2) with Excel spreadsheet attachments (Excel 2003) using vba code (thank you Ron De Bruin). The process has worked great, but now I want to add another spreadsheet column that will contain a formula that I want to be included in the attachment the email recipient receives (i.e., the recipient opens the attachment and enters their vehicle mileage into the spreadsheet and the conditional formula would display an error based on their input). With my current code, the formula does not come across with the attachment, only the actual error message that was in the spreadsheet when it was attached. Confusing, I know. Let me try again. Here is the formula I want to be included in the attachment:

    Please Login or Register  to view this content.
    If for example D2 is empty (column C has previous mileage, column D has current mileage), the formula would cause "ERROR, mileage not reported" to be displayed in E2. The problem is...only the message is what shows up in the email recipient's attachment (column E) and although it is still an accurate message for the recipient to see, I want the formula to also be there because the recipient will be asked to enter their mileage into the spreadsheet (and return to us) and the formula is supposed to alert them with the messages if the mileage they enter is wrong in some way.

    Here is the section of my code that does the sending. Was wondering if my problem had to do with the CreateRichTextItem of > Set obAttachment = noDocument.CreateRichTextItem("stAttachment"). I'm a novice at vba code..so any help/direction would be very much appreciated.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    01-13-2009
    Location
    Washington, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Lotus email attachment doesn't show Excel formula

    Since I haven't had any replies to my request for help, I'm wondering if I didn't explain my problem well enough or overwhelmed with too much superfluous info. Basically, what I want to be able to do is to modify an already working process of mass emailing a spreadsheet using Lotus notes, by including an Excel formula in the spreadsheet that is emailed. So the recipient should be able to open the attached spreadsheet in their email, enter some data and see the alert that the formula provides based on their input. How do you pass a formula using the mass emailing technique I used above?

  3. #3
    Registered User
    Join Date
    01-13-2009
    Location
    Washington, USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Lotus email attachment doesn't show Excel formula

    Problem solved. I assumed the problem had to do with the vba code used to pass the attachment and the variables (string?, objects? I don't have a real good grasp of this). But the problem instead was...simply related to the vba code that copies the data to the temp worksheet that is used for the attachment. What was needed, was to include the PasteSpecial code for pasting formulas in addition to the Paste Values and Paste Formats. Here's an excerpt.

    'Copies the data from the rng variable to the new email workbook
    rng.Copy
    With EmailWB.Sheets(1)
    .Cells(1).PasteSpecial Paste:=8
    .Cells(1).PasteSpecial Paste:=xlPasteValues
    .Cells(1).PasteSpecial Paste:=xlPasteFormats
    .Cells(1).PasteSpecial Paste:=xlPasteFormulas '12/13/2011 added so when the recipient opens attachment they can see the formula doing it's job based on the user's cell input
    .Cells(1).Select
    Application.CutCopyMode = False
    End With

+ 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