Send cell by email - protected sheet

menaaj

New Member
Joined
Jul 17, 2015
Messages
2
I have a worksheet that has cells/formulas protected so that the data
stays accurate. I left certain cells unprotected for others to access and
fill in their information. The problem is that when trying to send the
worksheet as the message body only by email, not an attachment, an error pops up
saying:

"A sheet in the workbook you are trying to save is password protected.
Password protected sheets cannot be saved in a Web Page. To save this file
as a Web Page, you must first remove the password."

Send the workbook as an attachment is not an option, any suggestions?

Thanks...
 

AOB

Well-known Member
Joined
Dec 15, 2010
Messages
598
If you are using VBA to generate the e-mail, try turning the protection off, then copying it to your e-mail, then switching it back on again?

Code:
Dim sht As Worksheet
With sht
    .Unprotect "Password"
    ....
    .Protect "Password"
End With
Also, I'm not sure how you are embedding the range into the body of the e-mail, but I tend to publish it to a HTML file :

Code:
Dim wbk As Workbook
Dim sht As Worksheet
Dim rng As Range

wbk.PublishObjects.Add xlSourceRange, "C:\Temp\Temp.htm", sht.Name, rng.Address, 0, "", ""
...and then read that into a text stream (using FSO) and add it to the HTML body of the MailItem. Might be worth looking into; I've never noticed it having an issue with protected cells...
 

menaaj

New Member
Joined
Jul 17, 2015
Messages
2
Thanks a lot the first solution, works pretty well :)

Regards from Costa Rica...
 

Forum statistics

Threads
1,082,305
Messages
5,364,406
Members
400,801
Latest member
julievandermeulen

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top