Hallo :-)
Ich benötige ein Script das mir eine Excel Datei im Ordner öffnet bestimmte Tabellenblätter deren Tabellenblattnamen ein bestimmtes Wort enthält beibehält und anschließen speichert.
Hier mein bisheriger code der like Operator scheint hier rumzumucken liegt bestimmt am Datentyp
CODE /*
Erweiterung = "xls"
function machdasweg(Datei)
Dateiname=Datei
set exApp = CreateObject("Excel.Application")
exApp.Visible = TRUE
set exBook = exApp.WorkBooks.Open(Dateiname) ' Excel Datei öffnen
Set exSheet = exBook.Sheets
for each Worksheet in exSheet
exApp.DisplayAlerts = False
for each Worksheet in exSheet
exApp.DisplayAlerts = False
If Worksheet.Name like "*WORT*" =False Then
Worksheet.Delete
end if
Next
exApp.DisplayAlerts = True
exApp.ActiveWorkbook.SaveAs Dateiname
exApp.Quit
Set exApp=Nothing
exApp.DisplayAlerts = False
If Worksheet.Name like "*WORT*" =False Then
Worksheet.Delete
end if
Next
exApp.DisplayAlerts = True
exApp.ActiveWorkbook.SaveAs Dateiname
exApp.Quit
Set exApp=Nothing
end function
set fs = CreateObject("Scripting.FilesystemObject")
scriptname = Wscript.ScriptFullName
scriptpath = fs.getparentfoldername(scriptname)
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set FileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='" & scriptpath & "'} Where " _
& "ResultClass = CIM_DataFile")
For Each objFile In FileList
If objFile.Extension = Erweiterung Then
test=machdasweg (objFile.Name)
End If
Next
*/
danke für eure Hilfe