Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding Tabs when sending through Outlook

Status
Not open for further replies.

Mizzness

Programmer
May 2, 2003
174
US
All.

How can I adjust my code to hide the Worksheet "Data" ?


Sub Mailer()
'

Application.ActiveWorkbook.Worksheets("Pivot").Activate
Application.ActiveWorkbook.Worksheets("Data").Activate


ESubject = "Subject"

SendTo = ""
Subject = ""
Ebody = ""
NewFileName = ""
Set App = CreateObject("Outlook.Application")
Set Itm = App.CreateItem(0)
With Itm
.Subject = ""
.To = SendTo
.Body = Ebody
.Attachments.Add ""
.Send
End With
Set App = Nothing
Set Itm = Nothing '
'
End Sub

Thanx.

 
To explain further, .Deactivate does not seem to work at hiding tabs I don't want others to view.

Is there another way ?

Thanx.
 
Replace this:
Application.ActiveWorkbook.Worksheets("Data").Activate
By this:
ActiveWorkbook.Worksheets("Data").Visible = xlSheetVeryHidden

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Close but not exactly.

I always want to see the tab however when I send the file, I don't want others to see the tab.
I'm looking for the flexibility of hiding any tabs I don't want others to see when they open the e-mail.
Your method hides it for me also.

Thanx.
Mizzness
 
Simply make the sheet visible by code AFTER the mail is sent.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top