Wie kan mij helpen?
Als in de volgende Macro laat lopen geeft hij op andere computers de volgende fout weer
Fout in module 11
Ik zelf werkt met Outlook Express
Hier het script wat ik gebruik:
Sub Verzenden1()
'De macro is opgenomen op 29-11-2008 door Arie Alblas.
'Werkt in 2000-2007
ActiveSheet.Unprotect
Dim Source As Range
Dim Dest As Workbook
Dim wb As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Set Source = Nothing
On Error Resume Next
Set Source = Range("B2:M66").SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Source Is Nothing Then
MsgBox "De groote is niet goed, of bestand is nog beveiligd.", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set wb = ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
With Dest.Sheets(1)
.Cells(1).PasteSpecial Paste:=8
.Cells(1).PasteSpecial Paste:=xlPasteValues
.Cells(1).PasteSpecial Paste:=xlPasteFormats
.Cells(1).Select
Application.CutCopyMode = False
End With
TempFilePath = Environ$("temp") & "\" (hier gaat het fout)
TempFileName = "Bestand " & wb.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'Je gebruik Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
Else
'Je gebruik Excel 2007
FileExtStr = ".xls": FileFormatNum = -4143
End If
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
On Error Resume Next
.SendMail "", _
"Uitslagenlijst ATP toernooi"
On Error GoTo 0
.Close savechanges:=False
End With
Kill TempFilePath & TempFileName & FileExtStr
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
ActiveSheet.Protect
End Sub
Als in de volgende Macro laat lopen geeft hij op andere computers de volgende fout weer
Fout in module 11
Ik zelf werkt met Outlook Express
Hier het script wat ik gebruik:
Sub Verzenden1()
'De macro is opgenomen op 29-11-2008 door Arie Alblas.
'Werkt in 2000-2007
ActiveSheet.Unprotect
Dim Source As Range
Dim Dest As Workbook
Dim wb As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Set Source = Nothing
On Error Resume Next
Set Source = Range("B2:M66").SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Source Is Nothing Then
MsgBox "De groote is niet goed, of bestand is nog beveiligd.", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Set wb = ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
With Dest.Sheets(1)
.Cells(1).PasteSpecial Paste:=8
.Cells(1).PasteSpecial Paste:=xlPasteValues
.Cells(1).PasteSpecial Paste:=xlPasteFormats
.Cells(1).Select
Application.CutCopyMode = False
End With
TempFilePath = Environ$("temp") & "\" (hier gaat het fout)
TempFileName = "Bestand " & wb.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'Je gebruik Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
Else
'Je gebruik Excel 2007
FileExtStr = ".xls": FileFormatNum = -4143
End If
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
On Error Resume Next
.SendMail "", _
"Uitslagenlijst ATP toernooi"
On Error GoTo 0
.Close savechanges:=False
End With
Kill TempFilePath & TempFileName & FileExtStr
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
ActiveSheet.Protect
End Sub