Glenn BarnasGlenn Barnas KiX Supporter
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
OK - I'm impressed that you got through a UDF as complex as xlLib in 5 days! Now you know I'm extra tough on my best students!
Here's code that's almost working on my system. I'm getting a COM error on xlRangeWrite, but this is the first time I've tried it on Excel 2007, so I'm not sure if that's related. I'll try it when I get home - I still have Office 2k3 on my laptop. If it works there, I'll look into what's needed for 2K7 support. Try it on 2K3 if you have it.
Couple of things I found:
You were right - it's Col/Row, not Row/Col.
Function is xlBookCreate, not xlNewBook as shown in the example. I'll fix that in the source.
You need to use xlQuit before the script ends, or you'll have many hidden copies of Excel running. If your script dies, you'll need to use Task Manager to kill Excel.
The process "'' + $Col + $Row" didn't work (the initial '' forced evaluation as a string). Changing to $Col + CStr($Row) provided a proper "A1" style specification.
Glenn
_________________________ Actually I am a Rocket Scientist!