Hallo Forumuser,
ich habe folgenden Code erstellt!!!
#cs ----------------------------------------------------------------------------
[/autoit][autoit][/autoit][autoit]AutoIt Version: 3.3.0.0
Author: Thomas Böhmer
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
[/autoit][autoit][/autoit][autoit]; Script Start - Add your code below here
[/autoit][autoit][/autoit][autoit]$oExcel = ObjCreate("Excel.Application") ; Create an Excel Object
$AN = "Abcde"
With $oExcel
[/autoit][autoit][/autoit][autoit].Visible = 1 ; Let Excel show itself
[/autoit][autoit][/autoit][autoit].WorkBooks.Add ; Add a new workbook
.ActiveWorkBook.ActiveSheet.Cells(1,3).Value="Abcde" ; Fill a cell
.ActiveWorkBook.ActiveSheet.Cells(5,2).Value="Acde"
.ActiveWorkBook.ActiveSheet.Cells(5,3).Value="Abcde"
.ActiveWorkBook.ActiveSheet.Cells(5,6).Value="Abcd"
.ActiveWorkBook.ActiveSheet.Cells(20,6).Value="Abcde"
.ActiveWorkBook.ActiveSheet.Cells(1,1).Value="1" ; Fill a cell
.ActiveWorkBook.ActiveSheet.Cells(5,1).Value="5"
.ActiveWorkBook.ActiveSheet.Cells(5,1).Value="5"
.ActiveWorkBook.ActiveSheet.Cells(5,1).Value="5"
.ActiveWorkBook.ActiveSheet.Cells(20,1).Value="20"
For $cell in .ActiveSheet.Range("A1:J500")
If $cell.Value = $AN Then
$cell.Select
$cell = .ActiveCell.Address
$spl = StringSplit($cell, "$")
$jbnr = .ActiveWorkBook.ActiveSheet.Cells($spl[3],1).Value
FileCopy("C:\test\" & $jbnr & "*.job", "D:\mydir\", 9)
Endif
Next
sleep(4000) ;See the results for 4 seconds
.ActiveWorkBook.Saved = 1 ; Simulate a save of the Workbook
.Quit ; Quit Excel
EndWith
Jetzt muss ich das ganze so umschreiben, das er keine neue Excel Datei erstellt sondern eine vorhandene öffnet und ausließt!
Kann mir vielleicht jemand helfen???
MfG
Thomas