Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default Question for dummy

Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW


  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,123
Default Question for dummy

Hi

Try this
http://www.rondebruin.nl/mail/folder3/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message ...
Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW



  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default Question for dummy

It's actually does not work for me. Any tricks I have to have?

Thx

"Ron de Bruin" wrote in message
...
Hi

Try this
http://www.rondebruin.nl/mail/folder3/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW





  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,123
Default Question for dummy

Hi Yuri

Do you have Outlook ?
Do you set the reference (read the page)
Do you copy the function also in the module


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message ...
It's actually does not work for me. Any tricks I have to have?

Thx

"Ron de Bruin" wrote in message ...
Hi

Try this
http://www.rondebruin.nl/mail/folder3/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message ...
Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW







  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default Question for dummy

Thx Ron,

I think I got it working. Is there a way to preserve format of XLS file?

"Ron de Bruin" wrote in message
...
Hi Yuri

Do you have Outlook ?
Do you set the reference (read the page)
Do you copy the function also in the module


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
It's actually does not work for me. Any tricks I have to have?

Thx

"Ron de Bruin" wrote in message
...
Hi

Try this
http://www.rondebruin.nl/mail/folder3/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW











  #6   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default Question for dummy

Here is the code I came up with.

Two problems:

1. When user clicks No to send an email - I get an error
2. I get an error in line "Set ts =
fso.GetFile(TempFile).OpenAsTextStream(1, -2)" on close too

Any help is appreciated.

Thx

=================================================

Private Sub Workbook_Open()
'WriteTwiki
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
WriteTwiki
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Mail_ActiveSheet_Body
End Sub
Sub Mail_ActiveSheet_Body()
Dim OutApp As Object
Dim OutMail As Object
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Test Systems useage has changed, please review"
.HTMLBody = SheetToHTML(ActiveSheet)
'.Display
.Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Function SheetToHTML(sh As Worksheet)
'Function from Dick Kusleika his site
'http://www.dicks-clicks.com/excel/sheettohtml.htm
'Changed by Ron de Bruin 04-Nov-2003
Dim TempFile As String
Dim Nwb As Workbook
Dim myshape As Shape
Dim fso As Object
Dim ts As Object
sh.Copy
Set Nwb = ActiveWorkbook
For Each myshape In Nwb.Sheets(1).Shapes
myshape.Delete
Next
TempFile = Environ$("temp") & "\" & _
Format(Now, "dd-mm-yy h-mm-ss") & ".htm"
Nwb.SaveAs TempFile, xlHtml
Nwb.Close False
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
SheetToHTML = ts.ReadAll
ts.Close
Set ts = Nothing
Set fso = Nothing
Set Nwb = Nothing
Kill TempFile
End Function

Sub WriteTwiki()
ActiveWorkbook.SaveAs _
Filename:="\\files.mercedsystems.com\qa-public\QA\DOC\instance_usage_new.html",
_
FileFormat:=xlHtml
'ActiveWorkbook.SendMail "
End Sub

===============================================

"Ron de Bruin" wrote in message
...
Hi Yuri

Do you have Outlook ?
Do you set the reference (read the page)
Do you copy the function also in the module


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
It's actually does not work for me. Any tricks I have to have?

Thx

"Ron de Bruin" wrote in message
...
Hi

Try this
http://www.rondebruin.nl/mail/folder3/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW









  #7   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default Question for dummy

I moved the function to miduel and is still does not work :-(

"Yuri Weinstein (HotMail)" wrote in message
...
Here is the code I came up with.

Two problems:

1. When user clicks No to send an email - I get an error
2. I get an error in line "Set ts =
fso.GetFile(TempFile).OpenAsTextStream(1, -2)" on close too

Any help is appreciated.

Thx

=================================================

Private Sub Workbook_Open()
'WriteTwiki
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
WriteTwiki
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Mail_ActiveSheet_Body
End Sub
Sub Mail_ActiveSheet_Body()
Dim OutApp As Object
Dim OutMail As Object
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Test Systems useage has changed, please review"
.HTMLBody = SheetToHTML(ActiveSheet)
'.Display
.Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Function SheetToHTML(sh As Worksheet)
'Function from Dick Kusleika his site
'http://www.dicks-clicks.com/excel/sheettohtml.htm
'Changed by Ron de Bruin 04-Nov-2003
Dim TempFile As String
Dim Nwb As Workbook
Dim myshape As Shape
Dim fso As Object
Dim ts As Object
sh.Copy
Set Nwb = ActiveWorkbook
For Each myshape In Nwb.Sheets(1).Shapes
myshape.Delete
Next
TempFile = Environ$("temp") & "\" & _
Format(Now, "dd-mm-yy h-mm-ss") & ".htm"
Nwb.SaveAs TempFile, xlHtml
Nwb.Close False
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
SheetToHTML = ts.ReadAll
ts.Close
Set ts = Nothing
Set fso = Nothing
Set Nwb = Nothing
Kill TempFile
End Function

Sub WriteTwiki()
ActiveWorkbook.SaveAs _

Filename:="\\files.mercedsystems.com\qa-public\QA\DOC\instance_usage_new.html",
_
FileFormat:=xlHtml
'ActiveWorkbook.SendMail "
End Sub

===============================================

"Ron de Bruin" wrote in message
...
Hi Yuri

Do you have Outlook ?
Do you set the reference (read the page)
Do you copy the function also in the module


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
It's actually does not work for me. Any tricks I have to have?

Thx

"Ron de Bruin" wrote in message
...
Hi

Try this
http://www.rondebruin.nl/mail/folder3/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW











  #8   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,123
Default Question for dummy

I will look at the file you send me.
Which excel version do you use

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message ...
I moved the function to miduel and is still does not work :-(

"Yuri Weinstein (HotMail)" wrote in message ...
Here is the code I came up with.

Two problems:

1. When user clicks No to send an email - I get an error
2. I get an error in line "Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)" on close too

Any help is appreciated.

Thx

=================================================

Private Sub Workbook_Open()
'WriteTwiki
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
WriteTwiki
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Mail_ActiveSheet_Body
End Sub
Sub Mail_ActiveSheet_Body()
Dim OutApp As Object
Dim OutMail As Object
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Test Systems useage has changed, please review"
.HTMLBody = SheetToHTML(ActiveSheet)
'.Display
.Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Function SheetToHTML(sh As Worksheet)
'Function from Dick Kusleika his site
'http://www.dicks-clicks.com/excel/sheettohtml.htm
'Changed by Ron de Bruin 04-Nov-2003
Dim TempFile As String
Dim Nwb As Workbook
Dim myshape As Shape
Dim fso As Object
Dim ts As Object
sh.Copy
Set Nwb = ActiveWorkbook
For Each myshape In Nwb.Sheets(1).Shapes
myshape.Delete
Next
TempFile = Environ$("temp") & "\" & _
Format(Now, "dd-mm-yy h-mm-ss") & ".htm"
Nwb.SaveAs TempFile, xlHtml
Nwb.Close False
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
SheetToHTML = ts.ReadAll
ts.Close
Set ts = Nothing
Set fso = Nothing
Set Nwb = Nothing
Kill TempFile
End Function

Sub WriteTwiki()
ActiveWorkbook.SaveAs _

Filename:="\\files.mercedsystems.com\qa-public\QA\DOC\instance_usage_new.html", _
FileFormat:=xlHtml
'ActiveWorkbook.SendMail "
End Sub

===============================================

"Ron de Bruin" wrote in message ...
Hi Yuri

Do you have Outlook ?
Do you set the reference (read the page)
Do you copy the function also in the module


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message ...
It's actually does not work for me. Any tricks I have to have?

Thx

"Ron de Bruin" wrote in message ...
Hi

Try this
http://www.rondebruin.nl/mail/folder3/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message ...
Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW













  #9   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default Question for dummy

It works now! Thx Ron.

"Ron de Bruin" wrote in message
...
I will look at the file you send me.
Which excel version do you use

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
I moved the function to miduel and is still does not work :-(

"Yuri Weinstein (HotMail)" wrote in message
...
Here is the code I came up with.

Two problems:

1. When user clicks No to send an email - I get an error
2. I get an error in line "Set ts =
fso.GetFile(TempFile).OpenAsTextStream(1, -2)" on close too

Any help is appreciated.

Thx

=================================================

Private Sub Workbook_Open()
'WriteTwiki
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
WriteTwiki
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Mail_ActiveSheet_Body
End Sub
Sub Mail_ActiveSheet_Body()
Dim OutApp As Object
Dim OutMail As Object
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Test Systems useage has changed, please review"
.HTMLBody = SheetToHTML(ActiveSheet)
'.Display
.Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Function SheetToHTML(sh As Worksheet)
'Function from Dick Kusleika his site
'http://www.dicks-clicks.com/excel/sheettohtml.htm
'Changed by Ron de Bruin 04-Nov-2003
Dim TempFile As String
Dim Nwb As Workbook
Dim myshape As Shape
Dim fso As Object
Dim ts As Object
sh.Copy
Set Nwb = ActiveWorkbook
For Each myshape In Nwb.Sheets(1).Shapes
myshape.Delete
Next
TempFile = Environ$("temp") & "\" & _
Format(Now, "dd-mm-yy h-mm-ss") & ".htm"
Nwb.SaveAs TempFile, xlHtml
Nwb.Close False
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
SheetToHTML = ts.ReadAll
ts.Close
Set ts = Nothing
Set fso = Nothing
Set Nwb = Nothing
Kill TempFile
End Function

Sub WriteTwiki()
ActiveWorkbook.SaveAs _

Filename:="\\files.mercedsystems.com\qa-public\QA\DOC\instance_usage_new.html",
_
FileFormat:=xlHtml
'ActiveWorkbook.SendMail "
End Sub

===============================================

"Ron de Bruin" wrote in message
...
Hi Yuri

Do you have Outlook ?
Do you set the reference (read the page)
Do you copy the function also in the module


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
It's actually does not work for me. Any tricks I have to have?

Thx

"Ron de Bruin" wrote in message
...
Hi

Try this
http://www.rondebruin.nl/mail/folder3/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in
message ...
Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW















  #10   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.newusers
external usenet poster
 
Posts: 81
Default Question for dummy

I use the following VBA and it really helps.

However, if i want to add a textbody from cell A1 at worksheet "data" before
the sheettohtml, how?

"Yuri Weinstein (HotMail)" wrote:

It works now! Thx Ron.

"Ron de Bruin" wrote in message
...
I will look at the file you send me.
Which excel version do you use

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
I moved the function to miduel and is still does not work :-(

"Yuri Weinstein (HotMail)" wrote in message
...
Here is the code I came up with.

Two problems:

1. When user clicks No to send an email - I get an error
2. I get an error in line "Set ts =
fso.GetFile(TempFile).OpenAsTextStream(1, -2)" on close too

Any help is appreciated.

Thx

=================================================

Private Sub Workbook_Open()
'WriteTwiki
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
WriteTwiki
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Mail_ActiveSheet_Body
End Sub
Sub Mail_ActiveSheet_Body()
Dim OutApp As Object
Dim OutMail As Object
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Test Systems useage has changed, please review"
.HTMLBody = SheetToHTML(ActiveSheet)
'.Display
.Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Function SheetToHTML(sh As Worksheet)
'Function from Dick Kusleika his site
'http://www.dicks-clicks.com/excel/sheettohtml.htm
'Changed by Ron de Bruin 04-Nov-2003
Dim TempFile As String
Dim Nwb As Workbook
Dim myshape As Shape
Dim fso As Object
Dim ts As Object
sh.Copy
Set Nwb = ActiveWorkbook
For Each myshape In Nwb.Sheets(1).Shapes
myshape.Delete
Next
TempFile = Environ$("temp") & "\" & _
Format(Now, "dd-mm-yy h-mm-ss") & ".htm"
Nwb.SaveAs TempFile, xlHtml
Nwb.Close False
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
SheetToHTML = ts.ReadAll
ts.Close
Set ts = Nothing
Set fso = Nothing
Set Nwb = Nothing
Kill TempFile
End Function

Sub WriteTwiki()
ActiveWorkbook.SaveAs _

Filename:="\\files.mercedsystems.com\qa-public\QA\DOC\instance_usage_new.html",
_
FileFormat:=xlHtml
'ActiveWorkbook.SendMail "
End Sub

===============================================

"Ron de Bruin" wrote in message
...
Hi Yuri

Do you have Outlook ?
Do you set the reference (read the page)
Do you copy the function also in the module


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in message
...
It's actually does not work for me. Any tricks I have to have?

Thx

"Ron de Bruin" wrote in message
...
Hi

Try this
http://www.rondebruin.nl/mail/folder3/mail2.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Yuri Weinstein (HotMail)" wrote in
message ...
Hi all,

I am trying to do the following:

- have and Excel file that can be modified by multiple users
- when user modifies it on close, save it as HTML and
- send an email (with Active Sheet in the email body)

I can get email be embedded into email body.
Thank in advance for your help.

YuriW
















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
Dummy variable in macros BWimer Excel Discussion (Misc queries) 1 April 4th 08 09:21 PM
Dummy Variables rz-illini85 Excel Discussion (Misc queries) 4 December 6th 06 11:45 AM
Excel Dummy - Please Help! Ed Excel Discussion (Misc queries) 9 November 13th 05 07:59 PM
Labels and Dummy Series nsv Charts and Charting in Excel 3 October 18th 05 09:51 AM
Question for dummy Yuri Weinstein \(HotMail\) New Users to Excel 9 June 17th 05 04:34 AM


All times are GMT +1. The time now is 06:04 AM.

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

About Us

"It's about Microsoft Excel"