AW: Danke Tino, diese Version funkt jetzt :-)) owT
18.07.2010 12:10:45
Tino
Hallo,
anstelle ThisWorkbook.Sheets(1).Name musst Du natürlich
den CodeNamen der Tabelle einsetzen.
Sub Kopieren_Ohne_VBA()
Dim oWB As Workbook, sTabCodeName$
Dim strFile$, strLines$
Dim booMeSaved As Boolean
booMeSaved = ThisWorkbook.Saved
sTabCodeName$ = ThisWorkbook.Sheets(1).CodeName
With ThisWorkbook.VBProject.VBComponents(sTabCodeName$).CodeModule
strLines$ = .Lines(1, .CountOfLines)
.DeleteLines 1, .CountOfLines
End With
strFile$ = IIf(Right$(ThisWorkbook.Path, 1) = "\", ThisWorkbook.Path, ThisWorkbook.Path & "\")
strFile$ = strFile$ & "Datei_Ohne_Makro.xls"
Tabelle1.Copy
Set oWB = ActiveWorkbook
With ThisWorkbook.VBProject.VBComponents(sTabCodeName$).CodeModule
.AddFromString strLines
End With
oWB.Sheets(1).Shapes(1).OnAction = ""
Application.DisplayAlerts = False
oWB.Close True, strFile
Application.DisplayAlerts = True
ThisWorkbook.Saved = booMeSaved
End Sub
Gruß Tino