Cosmiccradle
Technical User
I'm a newbie at this and need to change a small mistake in 2700 titles. To do it by hand would take weeks so I thought I'd try it with VBscripting. I understands macros but can't make heads or tails of this, I keep getting an error message on line 2. Line 6 is to start at the first title and then to the next, sorry for the Dutch words in it. Can anyone figure out what I'm doing wrong
1 Sub Log1()
2 CreateObject("Scripting.FileSystemObject")
3 Set Bestand = fso.CreateTextFile("c:\log1.txt", True)
4
5 Application.ActiveWindow.Command "z sel 22-05-2002"
6 Application.ActiveWindow.Command "t 1"
7
8 Aantal = Application.ActiveWindow.Variable("P3GSZ")
9
10 For Teller = 1 To Aantal
11 Application.ActiveWindow.SimulateIBWKey "F7"
12 Application.ActiveWindow.Title.ReplaceAll "c---j-m", "c---j", False
13 Application.ActiveWindow.SimulateIBWKey "FR"
14
15 If Application.ActiveWindow.Status = "ERROR" Then
16 Bestand.Writeline("PPN " & Application.ActiveWindow. _
17 Variable("P3GPP") & “had een foutstatus")
18 Application.ActiveWindow.SimulateIBWKey "FE"
19 Else
20 Bestand.Writeline("PPN " & Application.ActiveWindow. _
21 Variable("P3GPP") & “had geen foutstatus")
22 End If
23 Application.ActiveWindow.SimulateIBWKey "F1"
24 Next
25
26 Bestand.Close
27 End Sub
1 Sub Log1()
2 CreateObject("Scripting.FileSystemObject")
3 Set Bestand = fso.CreateTextFile("c:\log1.txt", True)
4
5 Application.ActiveWindow.Command "z sel 22-05-2002"
6 Application.ActiveWindow.Command "t 1"
7
8 Aantal = Application.ActiveWindow.Variable("P3GSZ")
9
10 For Teller = 1 To Aantal
11 Application.ActiveWindow.SimulateIBWKey "F7"
12 Application.ActiveWindow.Title.ReplaceAll "c---j-m", "c---j", False
13 Application.ActiveWindow.SimulateIBWKey "FR"
14
15 If Application.ActiveWindow.Status = "ERROR" Then
16 Bestand.Writeline("PPN " & Application.ActiveWindow. _
17 Variable("P3GPP") & “had een foutstatus")
18 Application.ActiveWindow.SimulateIBWKey "FE"
19 Else
20 Bestand.Writeline("PPN " & Application.ActiveWindow. _
21 Variable("P3GPP") & “had geen foutstatus")
22 End If
23 Application.ActiveWindow.SimulateIBWKey "F1"
24 Next
25
26 Bestand.Close
27 End Sub