Well, I actually threw together an application (applescript studio FTW!), but in my debug process, I found out that Excel 2004 (I'm using Excel X) completely changes its applescript dictionary. So not only am I having some issues with the finer points (and still don't know how it works with an actual barcode scanner...), but if you're using an up to date version of excel (or hey, one that's almost 4 years old), this won't work for you at all.
So basically, yes, it's doable. Very doable. Stupid easy, until you throw an interface at it. Then it's just time (I'm not too good yet at combining interfaces with applescript, so I loose a lot of time on stupid things).
If you just want to see how the (very very very) basic version is with nothing but Applescript, it would look something like this... assuming you have an excel workbook set up like this:
On a worksheet named 'Lookup', cell A1 is your item number input (your PLU). Cell A4 is a vlookup (for my quick throw together, =VLOOKUP(Lookup_Number, Item_Database, 2, FALSE) ). Cell A5 is a vlookup (=VLOOKUP(Lookup_Number, Item_Database, 3, FALSE)). For both of these, the database named range is on a different tab, and could be all columns on the page if you'd like, as long as row A is the PLU. On my sheet, row 2 and 3 of the database are the item name and price, respectively.
Note - for some (really) strange reason, any numbers formatted as currency will pass a null value to Applescript - so don't do it.
Anyhew, with that basic setup, this is what the very simple applescript would look like for Office X:
Code:
global display_1
global display_2
global lookup_value
initialize()
excel_lookup()
on button_click()
end button_click
on excel_lookup()
tell application "Microsoft Excel"
set Value of Cell "A1" to lookup_value
set display_1 to Value of Cell "A4"
set display_2 to Value of Cell "B4"
end tell
display dialog display_1 & return & return & "$" & display_2
end excel_lookup
on initialize()
tell application "Microsoft Excel"
Activate
Activate Workbook "sample.xls"
Activate Worksheet "Lookup"
end tell
tell application "System Events"
set visible of process "Microsoft Excel" to false
end tell
end initialize
If you have a keyboard available, you can run this applescript (or some variant thereof), scan a barcode, hit enter, and it'll come back with your item description and cost.
Again, this can be made pretty (and remove the need for a keyboard), but it would be a huge waste of my time to throw it together for Office X, and I don't have a copy of Office 2004.
<edit> Come to think of it, I've already wasted my time on it, but I haven't polished it... not much point though. This should get you going - the changes you'd need to make to this for Excel 2004 would be minimal, and it works. And it's free, which I believe meets your original requirement