I want to do the following:

With my web browser I go to my bank's web page and log in to my account.
Then a summary of all my accounts shows up. I select all of its text and
press Ctrl+c.

Then I switch to OpenOffice.org and I want my macro to do things with what's
in the clipboard.

As for now I solved the problem in an ugly way, by just pressing Ctrl+v to
paste it in some random cells, then select the cells and let the macro work
with what it gets from there and then finally erase those cells.

What I would like to do, is to get the information directly from the clip
board. Is that possible?

The data from my bank's web site seems to be plain text with \t (TAB
character) to separate the columns from each other.

I don't know if it's relevant, but I guess it won't hurt to tell you what I
want to do with the information from the clipboard:

I only want the last column, which is the sums of my accounts. Since my bank
use a character for a thousands delimiter, a dot actually, OpenOffice.org
thinks I am dealing with text if I paste it to a cell.

Since I'm Swedish, a number with two decimals can look like this: # ###
In the clipboard, it looks like this: #.###.##0,00 (some use dot between
each three numbers, but spaces are also common and looks nicer if you ask
In OpenOffice.org BASIC, I need to use this format, to make it work
properly: ######0.00
So my macro will simply remove all dots, which makes it look like this:
######0,00. Then it will replace the comma with a dot, like this:
######0.00. Setting the value of a cell to something in that format, like
1234.57, will make the cell to be numerical. If I look in the cell directly
on the spreadsheet, it will look like 1234,57, since my default language is
set to Swedish, but obviously OpenOffice.org BASIC doesn't care about that.

Well, there you have some unnecessary information, but perhaps it explains a
bit things like what and why…

So, to sum it up, I need to read from the clipboard, perhaps row by row,
determining the last column of each row, convert it to a format that makes
more sense and then paste the converted values to some cells in the
spreadsheet. The macro I've already written already deals with the
formatting and it works fine, but it reads the information from other cells
rather than from the clipboard, and I want to obtain the information
DIRECTLY from the clipboard.

I hope this is not too confusing…

What I need to know is just how to get what's currently in the clipboard…

Best regards

Johnny Rosenberg

Reply via email to