in reply to Win32::OLE Woes

The reason the error happens is Excel won't set the border for xlInsideHorizontal or xlInsideVertical on a single cell selection. If there are no inside edges to set, Excel gives you an error, and not a very helpful one. You'll need to check which ranges span multiple columns or rows, then only set those properties as needed.

If you want to see this for yourself, put $xl->{Visible} = True; right after you create $xl, then take B1 out of @ranges. You'll see that it works until the range doesn't support one of xlInsideHorizontal or xlInsideVertical.

Replies are listed 'Best First'.
Re: Re: Win32::OLE Woes
by dimmesdale (Friar) on Jul 16, 2002 at 15:17 UTC
    Once I figured out what a macro was (did I say I was new to excel? :) I got the problem straihgtened out.. Thanks. Also, as I said in the chatterbox, the problem wasn't excel or perl or anything. IT WAS ME!

    I had a test.xls in my cwd. Excel, as I have been told (and found out :( has its own cwd, which it created test.xls in. Unbenownst to me, I looked at the old test.xls (which was blank because I had been using writeExcel, and well, long story).