Hi Gary,
The Graph window will be active after your "win -t" statement, so when using plotxy you don't have to specify window name, you can change your code to be like this:
plotxy iy:= [Dbk$]Dwks$!(1,$(ii)) plot:=200 ogl:=1!;
This will add the plot to 1st layer of active window, which will be your graph window.
Also, when you issue win -t, right after that statement you can get and save the %h variable which will have window name, if you want to use the name later for some reason such as not reliable to assume active graph.
win -t plot line; //Generates the graph
string mygraph$ = %h; // get and save window name;
loop (ii, 2, $(numFile)/2+2)
{
plotxy iy:=[book1]sheet1!(1,2) plot:=200 ogl:=[mygraph$]1!;
} //Plots curves on the graph