Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Saving a single worksheet

I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Saving a single worksheet

Check out this link...

http://www.rondebruin.nl/sendmail.htm
--
HTH...

Jim Thomlinson


"Shawn" wrote:

I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Saving a single worksheet

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Saving a single worksheet

ya'll are awesome...I have been working on this all day!

"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Saving a single worksheet

Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Saving a single worksheet

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?


Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Saving a single worksheet

Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?


Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Saving a single worksheet

If the name of the mail macro in your standard module = MailSingleSheet

Then the click event in the sheet module looks like this

Private Sub CommandButton1_Click()
call MailSingleSheet
End Sub





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?


Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Saving a single worksheet

I changed the button from command button to a tool bar button so it would not
show on the emailed page. Now I need to change from ActiveSheet to a
designated sheet or the button may send the wrong sheet. Also I am trying to
set up an additional button that will mail the first three worksheets in the
workbook. I looked at your instructions for mailing multiple sheets and I
don't understand where I substitute in the macro the sheet names that I need
to be mailed. Help again please!

"Ron de Bruin" wrote:

If the name of the mail macro in your standard module = MailSingleSheet

Then the click event in the sheet module looks like this

Private Sub CommandButton1_Click()
call MailSingleSheet
End Sub





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?

Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub





  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Saving a single worksheet

http://www.rondebruin.nl/mail/folder1/mail3.htm

Read the info above the macro

This sub will send a newly created workbook with just the sheets in the Array.

Sourcewb.Sheets(Array("Sheet1", "Sheet3")).Copy



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I changed the button from command button to a tool bar button so it would not
show on the emailed page. Now I need to change from ActiveSheet to a
designated sheet or the button may send the wrong sheet. Also I am trying to
set up an additional button that will mail the first three worksheets in the
workbook. I looked at your instructions for mailing multiple sheets and I
don't understand where I substitute in the macro the sheet names that I need
to be mailed. Help again please!

"Ron de Bruin" wrote:

If the name of the mail macro in your standard module = MailSingleSheet

Then the click event in the sheet module looks like this

Private Sub CommandButton1_Click()
call MailSingleSheet
End Sub





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?

Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub







  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Saving a single worksheet


Sourcewb.Sheets(Array("Index", "MailSheet(s)")).Copy
In the above line do I substitute the name of my pages in "Index" and leave
Mailsheet(s) in. Also do I use the name of my sheets or Sheet1,Sheet2..etc.
I can't seem to get it to work on this one
"Ron de Bruin" wrote:

http://www.rondebruin.nl/mail/folder1/mail3.htm

Read the info above the macro

This sub will send a newly created workbook with just the sheets in the Array.

Sourcewb.Sheets(Array("Sheet1", "Sheet3")).Copy



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I changed the button from command button to a tool bar button so it would not
show on the emailed page. Now I need to change from ActiveSheet to a
designated sheet or the button may send the wrong sheet. Also I am trying to
set up an additional button that will mail the first three worksheets in the
workbook. I looked at your instructions for mailing multiple sheets and I
don't understand where I substitute in the macro the sheet names that I need
to be mailed. Help again please!

"Ron de Bruin" wrote:

If the name of the mail macro in your standard module = MailSingleSheet

Then the click event in the sheet module looks like this

Private Sub CommandButton1_Click()
call MailSingleSheet
End Sub





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?

Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub






  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Saving a single worksheet

You use the names of the sheets you want to send



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...

Sourcewb.Sheets(Array("Index", "MailSheet(s)")).Copy
In the above line do I substitute the name of my pages in "Index" and leave
Mailsheet(s) in. Also do I use the name of my sheets or Sheet1,Sheet2..etc.
I can't seem to get it to work on this one
"Ron de Bruin" wrote:

http://www.rondebruin.nl/mail/folder1/mail3.htm

Read the info above the macro

This sub will send a newly created workbook with just the sheets in the Array.

Sourcewb.Sheets(Array("Sheet1", "Sheet3")).Copy



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I changed the button from command button to a tool bar button so it would not
show on the emailed page. Now I need to change from ActiveSheet to a
designated sheet or the button may send the wrong sheet. Also I am trying to
set up an additional button that will mail the first three worksheets in the
workbook. I looked at your instructions for mailing multiple sheets and I
don't understand where I substitute in the macro the sheet names that I need
to be mailed. Help again please!

"Ron de Bruin" wrote:

If the name of the mail macro in your standard module = MailSingleSheet

Then the click event in the sheet module looks like this

Private Sub CommandButton1_Click()
call MailSingleSheet
End Sub





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?

Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub






  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Saving a single worksheet

What is the real difference between the macro for sending multiple pages with
the SendMail method compared to the ones for sending multiples using Outlook
object model. I can't really tell the difference and maybe that is why I
cannot get it to work on my end.

"Ron de Bruin" wrote:

You use the names of the sheets you want to send



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...

Sourcewb.Sheets(Array("Index", "MailSheet(s)")).Copy
In the above line do I substitute the name of my pages in "Index" and leave
Mailsheet(s) in. Also do I use the name of my sheets or Sheet1,Sheet2..etc.
I can't seem to get it to work on this one
"Ron de Bruin" wrote:

http://www.rondebruin.nl/mail/folder1/mail3.htm

Read the info above the macro

This sub will send a newly created workbook with just the sheets in the Array.

Sourcewb.Sheets(Array("Sheet1", "Sheet3")).Copy



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I changed the button from command button to a tool bar button so it would not
show on the emailed page. Now I need to change from ActiveSheet to a
designated sheet or the button may send the wrong sheet. Also I am trying to
set up an additional button that will mail the first three worksheets in the
workbook. I looked at your instructions for mailing multiple sheets and I
don't understand where I substitute in the macro the sheet names that I need
to be mailed. Help again please!

"Ron de Bruin" wrote:

If the name of the mail macro in your standard module = MailSingleSheet

Then the click event in the sheet module looks like this

Private Sub CommandButton1_Click()
call MailSingleSheet
End Sub





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?

Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub







  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Saving a single worksheet

Above the SendMail macro you can read it

Note: With SendMail it is not possible to
1) Send text in the Body of the mail
2) Use the CC or BCC field
3) Attach other files

Send me the file private and tell me which sheets you want to mail

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
What is the real difference between the macro for sending multiple pages with
the SendMail method compared to the ones for sending multiples using Outlook
object model. I can't really tell the difference and maybe that is why I
cannot get it to work on my end.

"Ron de Bruin" wrote:

You use the names of the sheets you want to send



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...

Sourcewb.Sheets(Array("Index", "MailSheet(s)")).Copy
In the above line do I substitute the name of my pages in "Index" and leave
Mailsheet(s) in. Also do I use the name of my sheets or Sheet1,Sheet2..etc.
I can't seem to get it to work on this one
"Ron de Bruin" wrote:

http://www.rondebruin.nl/mail/folder1/mail3.htm

Read the info above the macro

This sub will send a newly created workbook with just the sheets in the Array.

Sourcewb.Sheets(Array("Sheet1", "Sheet3")).Copy



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I changed the button from command button to a tool bar button so it would not
show on the emailed page. Now I need to change from ActiveSheet to a
designated sheet or the button may send the wrong sheet. Also I am trying to
set up an additional button that will mail the first three worksheets in the
workbook. I looked at your instructions for mailing multiple sheets and I
don't understand where I substitute in the macro the sheet names that I need
to be mailed. Help again please!

"Ron de Bruin" wrote:

If the name of the mail macro in your standard module = MailSingleSheet

Then the click event in the sheet module looks like this

Private Sub CommandButton1_Click()
call MailSingleSheet
End Sub





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?

Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub








  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Saving a single worksheet

I have sent it to the email address on your website! Thanks again!

"Ron de Bruin" wrote:

Above the SendMail macro you can read it

Note: With SendMail it is not possible to
1) Send text in the Body of the mail
2) Use the CC or BCC field
3) Attach other files

Send me the file private and tell me which sheets you want to mail

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
What is the real difference between the macro for sending multiple pages with
the SendMail method compared to the ones for sending multiples using Outlook
object model. I can't really tell the difference and maybe that is why I
cannot get it to work on my end.

"Ron de Bruin" wrote:

You use the names of the sheets you want to send



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...

Sourcewb.Sheets(Array("Index", "MailSheet(s)")).Copy
In the above line do I substitute the name of my pages in "Index" and leave
Mailsheet(s) in. Also do I use the name of my sheets or Sheet1,Sheet2..etc.
I can't seem to get it to work on this one
"Ron de Bruin" wrote:

http://www.rondebruin.nl/mail/folder1/mail3.htm

Read the info above the macro

This sub will send a newly created workbook with just the sheets in the Array.

Sourcewb.Sheets(Array("Sheet1", "Sheet3")).Copy



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I changed the button from command button to a tool bar button so it would not
show on the emailed page. Now I need to change from ActiveSheet to a
designated sheet or the button may send the wrong sheet. Also I am trying to
set up an additional button that will mail the first three worksheets in the
workbook. I looked at your instructions for mailing multiple sheets and I
don't understand where I substitute in the macro the sheet names that I need
to be mailed. Help again please!

"Ron de Bruin" wrote:

If the name of the mail macro in your standard module = MailSingleSheet

Then the click event in the sheet module looks like this

Private Sub CommandButton1_Click()
call MailSingleSheet
End Sub





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?

Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub











  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Saving a single worksheet

I send you the file back with a example

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I have sent it to the email address on your website! Thanks again!

"Ron de Bruin" wrote:

Above the SendMail macro you can read it

Note: With SendMail it is not possible to
1) Send text in the Body of the mail
2) Use the CC or BCC field
3) Attach other files

Send me the file private and tell me which sheets you want to mail

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
What is the real difference between the macro for sending multiple pages with
the SendMail method compared to the ones for sending multiples using Outlook
object model. I can't really tell the difference and maybe that is why I
cannot get it to work on my end.

"Ron de Bruin" wrote:

You use the names of the sheets you want to send



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...

Sourcewb.Sheets(Array("Index", "MailSheet(s)")).Copy
In the above line do I substitute the name of my pages in "Index" and leave
Mailsheet(s) in. Also do I use the name of my sheets or Sheet1,Sheet2..etc.
I can't seem to get it to work on this one
"Ron de Bruin" wrote:

http://www.rondebruin.nl/mail/folder1/mail3.htm

Read the info above the macro

This sub will send a newly created workbook with just the sheets in the Array.

Sourcewb.Sheets(Array("Sheet1", "Sheet3")).Copy



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
I changed the button from command button to a tool bar button so it would not
show on the emailed page. Now I need to change from ActiveSheet to a
designated sheet or the button may send the wrong sheet. Also I am trying to
set up an additional button that will mail the first three worksheets in the
workbook. I looked at your instructions for mailing multiple sheets and I
don't understand where I substitute in the macro the sheet names that I need
to be mailed. Help again please!

"Ron de Bruin" wrote:

If the name of the mail macro in your standard module = MailSingleSheet

Then the click event in the sheet module looks like this

Private Sub CommandButton1_Click()
call MailSingleSheet
End Sub





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Hate to seem stupid but where do I insert Call MacroName and do I replace
Name with something else?

"Ron de Bruin" wrote:

Use only this line in the click event

Call MacroName


Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?

Correct
Download the example workbook from my site and you will see it

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message ...
Ron,
I used the script for Mil one sheet in Outlook object model (attachment). I
am trying to apply this macro to a command button in the sheet. The command
button applies:
Private Sub CommandButton1_Click()
Which is expecting and End command. If I delete that nothing happens when I
try the button. What should I do?
Also, if I use display under the lines for OutMail will it stop at the point
where I will have to push the send button for the message to go?
With OutMail
.To = "
.CC = "Central Lab"
'.BCC = ""
.Subject = "Central Lab Weekly WIG Update"
.Body = "Weekly WIG Update"
.Attachments.Add Destwb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
"Ron de Bruin" wrote:

Hi Shawn

See
http://www.rondebruin.nl/sendmail.htm




Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Shawn" wrote in message
...
I am trying to ise a command button to save a single worksheet from a
workbook to export to outlook and mail it. So far I have the following which
works fine but mails the whole workbook. My code is not good so details are
appreciated.
Private Sub CommandButton1_Click()
'
'' Email Sheet
' Taken from Dustin's timesheet macro
' 1/28/08
'

Dim Fname
Fname = ActiveSheet.Name

Range("A1:N41").Select
Selection.Copy
'Sheets.Add
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.DisplayGridlines = False 'added
Application.CutCopyMode = False 'added
Application.StandardFont = "Tahoma"
Application.StandardFontSize = "10"
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
With ActiveSheet.PageSetup
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.25)
End With
ChDir "C:\"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\SHD_current_week.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True
Application.Dialogs(xlDialogSendMail).Show
End Sub










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
merging single worksheet files into a single workbook DDK Excel Discussion (Misc queries) 1 December 5th 06 05:25 PM
Saving a single worksheet as new file before close MDC[_3_] Excel Programming 1 May 12th 06 10:53 PM
Save a single worksheet in Excel as a single file. Dakota New Users to Excel 4 February 22nd 06 04:46 PM
Saving a single Worksheet w/o redundant prompts Jeff Harbin[_4_] Excel Programming 3 November 13th 05 09:22 PM
saving single worksheet E.J. van Wijngaarden Excel Programming 3 April 10th 04 03:34 PM


All times are GMT +1. The time now is 08:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"