Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Last cell?

by cacharbe (Curate)
on Jan 28, 2003 at 19:38 UTC ( #230706=note: print w/replies, xml ) Need Help??

in reply to Last cell?
in thread Using Win32::OLE and Excel - Tips and Tricks

Upon further investigation, I have found that this is not reliable if the columnar data is not of equal row size. It returns the last row of the right most column, which is incorrect in some cases.

The methods I used in the examples return the last row (over all) and the last column (over all) vs finding the location of the last cell in the last column

So, if the data on the worksheet is symmetric, your function works faster, however yours would not be reliable to, say, put edges around all the cells in a data set that has columns of different row sizes


Flex the Geek

Replies are listed 'Best First'.
last row/column
by Foggy Bottoms (Monk) on Jun 18, 2003 at 09:35 UTC
    If the method you'd come up originally doesn't work fine with non "square" sheets then what would you recommend.
    Furthermore, I can't seem to be able to make your original last row/column script work. The dos prompt tells me the following :
    Bareword "xlPrevious" not allowed while "strict subs" in use at D:\sou +rce\ line 30. Bareword "xlByRows" not allowed while "strict subs" in use at D:\sourc +e\ line 30. Bareword "xlPrevious" not allowed while "strict subs" in use at D:\sou +rce\ line 33. Bareword "xlByColumns" not allowed while "strict subs" in use at D:\so +urce\ line 33.
    What should I do ?

    edit (broquaint): changed <pre> to <code> tags

last row/column
by Foggy Bottoms (Monk) on Jun 18, 2003 at 09:37 UTC
    Sorry about the previous post - I found out what wasn't working about the xlPrevious and I included the
    use Win32::OLE::Const 'Microsoft Excel';
    line. Thanks again and great tutorial. How about PowerPoint someday ?

      That's actaully in the works. It's a little more hairy than Excel (which is actually the easiest of the Office suites, aside from maybe Outlook). I will probably post a MSWord and Powerpoint both over the next few months.

      I haven't had to do create a powerpoint specific project yet, so most of what I have is just snippets, but I've cranked out a couple of word related projects, and I'm trying to distill them down into a workable tutorial.

      Stay tuned.


      Flex the Geek

        Let me know - I'm pretty interested because I've been working on OLE since the beginning of June and I'm starting to get the hang of it. I've explored PowerPoint a little but rather unsuccesfully (hence my question). As for Word, I thought it was pretty easy.
        Perhaps we can work together on some sort of OLE tips page. I'd be glad to share what I've learned so far.
        See you round...

        Sunt qui sciant

Re: Re: Last cell?
by Nkuvu (Priest) on Mar 04, 2003 at 23:01 UTC

    Interesting. I don't seem to have run into this, but I wasn't explicitly looking for it, either. I'll have to do some more research on the matter.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://230706]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2023-03-30 04:18 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (73 votes). Check out past polls.