Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Turn off Security Alert dailog box for office 2007

Hello from Steved

I would like to please put in a command to the below that will turn off
Security Alert dailog box I use office 2007

Thankyou.
Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("1-City", "1-City", "2-Roskill", "2-Roskill",
"3-Papakura", "3-Papakura", "4-Wiri", "4-Wiri", "5-Shore", "5-Shore",
"6-Orewa", "6-Orewa", "7-Swanson", "7-Swanson", "8-Panmure", "8-Panmure")
Addr = Array("Bret Wilson", "Gavin Cook", "Colin Somerville", "Roskill
Tutor", "Warren Fowler", "Lisa Craik", "Warren Fowler", "Lisa Craik", "John
Taylor", "Janet Dunthorne", "John Taylor", "Janet Dunthorne", "Ralph
Williams", "Barbara Allen", "Bret Wilson", "Gavin Cook")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Drivers Annulments"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Turn off Security Alert dailog box for office 2007

I'm still using 2003, but I suppose I should upgrade soon. I don't know much
about 2007, but I would think you probably need something like this at the
beginning of your code:

Application.DisplayAlerts = False

....and you would probably need something like that at the end of your code:

Application.DisplayAlerts = True.

So, just try that and see what happens.

Good luck,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Steved" wrote:

Hello from Steved

I would like to please put in a command to the below that will turn off
Security Alert dailog box I use office 2007

Thankyou.
Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("1-City", "1-City", "2-Roskill", "2-Roskill",
"3-Papakura", "3-Papakura", "4-Wiri", "4-Wiri", "5-Shore", "5-Shore",
"6-Orewa", "6-Orewa", "7-Swanson", "7-Swanson", "8-Panmure", "8-Panmure")
Addr = Array("Bret Wilson", "Gavin Cook", "Colin Somerville", "Roskill
Tutor", "Warren Fowler", "Lisa Craik", "Warren Fowler", "Lisa Craik", "John
Taylor", "Janet Dunthorne", "John Taylor", "Janet Dunthorne", "Ralph
Williams", "Barbara Allen", "Bret Wilson", "Gavin Cook")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Drivers Annulments"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Turn off Security Alert dailog box for office 2007

See
http://www.rondebruin.nl/mail/prevent.htm



--

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




"Steved" wrote in message ...
Hello from Steved

I would like to please put in a command to the below that will turn off
Security Alert dailog box I use office 2007

Thankyou.
Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("1-City", "1-City", "2-Roskill", "2-Roskill",
"3-Papakura", "3-Papakura", "4-Wiri", "4-Wiri", "5-Shore", "5-Shore",
"6-Orewa", "6-Orewa", "7-Swanson", "7-Swanson", "8-Panmure", "8-Panmure")
Addr = Array("Bret Wilson", "Gavin Cook", "Colin Somerville", "Roskill
Tutor", "Warren Fowler", "Lisa Craik", "Warren Fowler", "Lisa Craik", "John
Taylor", "Janet Dunthorne", "John Taylor", "Janet Dunthorne", "Ralph
Williams", "Barbara Allen", "Bret Wilson", "Gavin Cook")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Drivers Annulments"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Turn off Security Alert dailog box for office 2007

Hello from Steved

I did as explained but it still displays.

Thankyou

"ryguy7272" wrote:

I'm still using 2003, but I suppose I should upgrade soon. I don't know much
about 2007, but I would think you probably need something like this at the
beginning of your code:

Application.DisplayAlerts = False

...and you would probably need something like that at the end of your code:

Application.DisplayAlerts = True.

So, just try that and see what happens.

Good luck,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Steved" wrote:

Hello from Steved

I would like to please put in a command to the below that will turn off
Security Alert dailog box I use office 2007

Thankyou.
Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("1-City", "1-City", "2-Roskill", "2-Roskill",
"3-Papakura", "3-Papakura", "4-Wiri", "4-Wiri", "5-Shore", "5-Shore",
"6-Orewa", "6-Orewa", "7-Swanson", "7-Swanson", "8-Panmure", "8-Panmure")
Addr = Array("Bret Wilson", "Gavin Cook", "Colin Somerville", "Roskill
Tutor", "Warren Fowler", "Lisa Craik", "Warren Fowler", "Lisa Craik", "John
Taylor", "Janet Dunthorne", "John Taylor", "Janet Dunthorne", "Ralph
Williams", "Barbara Allen", "Bret Wilson", "Gavin Cook")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Drivers Annulments"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Turn off Security Alert dailog box for office 2007

Is that what you're after? i totally misunderstood. Try ClickYes, or this:
http://www.mapilab.com/outlook/security/

For a small sampling of emails, the ClickYes is a great little program.
However, for larger email batches, use the link to the resource above.

You run this once on a computer when your Outlook message is created, and
then the security warnings never appear again; you don't have to wait for
5-second delays...

HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/prevent.htm



--

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




"Steved" wrote in message ...
Hello from Steved

I would like to please put in a command to the below that will turn off
Security Alert dailog box I use office 2007

Thankyou.
Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("1-City", "1-City", "2-Roskill", "2-Roskill",
"3-Papakura", "3-Papakura", "4-Wiri", "4-Wiri", "5-Shore", "5-Shore",
"6-Orewa", "6-Orewa", "7-Swanson", "7-Swanson", "8-Panmure", "8-Panmure")
Addr = Array("Bret Wilson", "Gavin Cook", "Colin Somerville", "Roskill
Tutor", "Warren Fowler", "Lisa Craik", "Warren Fowler", "Lisa Craik", "John
Taylor", "Janet Dunthorne", "John Taylor", "Janet Dunthorne", "Ralph
Williams", "Barbara Allen", "Bret Wilson", "Gavin Cook")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Drivers Annulments"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Turn off Security Alert dailog box for office 2007

Hello Ron

I Have outlook Outlook 2007 So I have no joy

Is their code I can point in my Macro That will do the trick please.

I Thankyou

Steved



"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/prevent.htm



--

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




"Steved" wrote in message ...
Hello from Steved

I would like to please put in a command to the below that will turn off
Security Alert dailog box I use office 2007

Thankyou.
Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("1-City", "1-City", "2-Roskill", "2-Roskill",
"3-Papakura", "3-Papakura", "4-Wiri", "4-Wiri", "5-Shore", "5-Shore",
"6-Orewa", "6-Orewa", "7-Swanson", "7-Swanson", "8-Panmure", "8-Panmure")
Addr = Array("Bret Wilson", "Gavin Cook", "Colin Somerville", "Roskill
Tutor", "Warren Fowler", "Lisa Craik", "Warren Fowler", "Lisa Craik", "John
Taylor", "Janet Dunthorne", "John Taylor", "Janet Dunthorne", "Ralph
Williams", "Barbara Allen", "Bret Wilson", "Gavin Cook")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Drivers Annulments"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Turn off Security Alert dailog box for office 2007

If your AV is OK then you not see the security warnings

What do you use ( Av software)

--

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




"Steved" wrote in message ...
Hello Ron

I Have outlook Outlook 2007 So I have no joy

Is their code I can point in my Macro That will do the trick please.

I Thankyou

Steved



"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/prevent.htm



--

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




"Steved" wrote in message ...
Hello from Steved

I would like to please put in a command to the below that will turn off
Security Alert dailog box I use office 2007

Thankyou.
Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("1-City", "1-City", "2-Roskill", "2-Roskill",
"3-Papakura", "3-Papakura", "4-Wiri", "4-Wiri", "5-Shore", "5-Shore",
"6-Orewa", "6-Orewa", "7-Swanson", "7-Swanson", "8-Panmure", "8-Panmure")
Addr = Array("Bret Wilson", "Gavin Cook", "Colin Somerville", "Roskill
Tutor", "Warren Fowler", "Lisa Craik", "Warren Fowler", "Lisa Craik", "John
Taylor", "Janet Dunthorne", "John Taylor", "Janet Dunthorne", "Ralph
Williams", "Barbara Allen", "Bret Wilson", "Gavin Cook")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Drivers Annulments"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Turn off Security Alert dailog box for office 2007

Hi Steve

You can read this in the MS article

If Outlook is able to detect that antivirus software is running with an acceptable status, Outlook disables security warnings for
the user

Try to find a answer on the Symantec site


--

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




"Steved" wrote in message ...
Hello Ron

I Use Symantec Endpoint Solution.

Steved


"Ron de Bruin" wrote:

If your AV is OK then you not see the security warnings

What do you use ( Av software)

--

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




"Steved" wrote in message ...
Hello Ron

I Have outlook Outlook 2007 So I have no joy

Is their code I can point in my Macro That will do the trick please.

I Thankyou

Steved



"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/prevent.htm



--

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




"Steved" wrote in message ...
Hello from Steved

I would like to please put in a command to the below that will turn off
Security Alert dailog box I use office 2007

Thankyou.
Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("1-City", "1-City", "2-Roskill", "2-Roskill",
"3-Papakura", "3-Papakura", "4-Wiri", "4-Wiri", "5-Shore", "5-Shore",
"6-Orewa", "6-Orewa", "7-Swanson", "7-Swanson", "8-Panmure", "8-Panmure")
Addr = Array("Bret Wilson", "Gavin Cook", "Colin Somerville", "Roskill
Tutor", "Warren Fowler", "Lisa Craik", "Warren Fowler", "Lisa Craik", "John
Taylor", "Janet Dunthorne", "John Taylor", "Janet Dunthorne", "Ralph
Williams", "Barbara Allen", "Bret Wilson", "Gavin Cook")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Drivers Annulments"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 519
Default Turn off Security Alert dailog box for office 2007

Hello Ron

Thankyou

Steved

"Ron de Bruin" wrote:

Hi Steve

You can read this in the MS article

If Outlook is able to detect that antivirus software is running with an acceptable status, Outlook disables security warnings for
the user

Try to find a answer on the Symantec site


--

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




"Steved" wrote in message ...
Hello Ron

I Use Symantec Endpoint Solution.

Steved


"Ron de Bruin" wrote:

If your AV is OK then you not see the security warnings

What do you use ( Av software)

--

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




"Steved" wrote in message ...
Hello Ron

I Have outlook Outlook 2007 So I have no joy

Is their code I can point in my Macro That will do the trick please.

I Thankyou

Steved



"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/prevent.htm



--

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




"Steved" wrote in message ...
Hello from Steved

I would like to please put in a command to the below that will turn off
Security Alert dailog box I use office 2007

Thankyou.
Sub MailToDepots()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("1-City", "1-City", "2-Roskill", "2-Roskill",
"3-Papakura", "3-Papakura", "4-Wiri", "4-Wiri", "5-Shore", "5-Shore",
"6-Orewa", "6-Orewa", "7-Swanson", "7-Swanson", "8-Panmure", "8-Panmure")
Addr = Array("Bret Wilson", "Gavin Cook", "Colin Somerville", "Roskill
Tutor", "Warren Fowler", "Lisa Craik", "Warren Fowler", "Lisa Craik", "John
Taylor", "Janet Dunthorne", "John Taylor", "Janet Dunthorne", "Ralph
Williams", "Barbara Allen", "Bret Wilson", "Gavin Cook")

If Val(Application.Version) = 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
With ActiveSheet.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Drivers Annulments"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
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
Macro Security in Office 2007 Vick Excel Discussion (Misc queries) 1 August 20th 09 11:11 PM
Security Alert Macros have been disabled - Excel 2007 Heera[_2_] Excel Programming 4 February 11th 09 09:37 PM
Security Alert Macros have been disabled - Excel 2007 Heera[_2_] Excel Programming 1 February 11th 09 06:39 PM
Office 2007 Excel security stronger? XP Excel Programming 0 May 1st 08 08:41 PM
Security Alert Window Excel 2007 KT Excel Discussion (Misc queries) 1 August 11th 07 12:14 AM


All times are GMT +1. The time now is 02:40 PM.

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"