I don't think functions have access to the calling object or document, for reasons I cannot explain.
That's what I thought.
I want to access the spreadsheet from a function so that a single function call can store outputs in more than one cell. My function takes an argument (the name of a product) and calls up a dialog that says "Browse for the picture of: <product name>". Then, you press the browse button which opens a "file open" dialog". After the pic is selected and the "OK" button is pressed, the file name is output to the cell in which the function was called. I can autofill the function down a column of a spread sheet that has all our products, prices, etc. and then quickly fetch all the file names for the product pics. It puts everything into a nice format that I can upload to our web site. The problem is, every time I open the spreadsheet I have to re-browse for all the pics. There's a few hundred of them. If I could write the file name to a second column then my function could check that column to see if the file name has already been found.
I could do it all as a loop in a macro but I would have to continually edit the macro as the product spreadsheet is modified. I guess I'll have to do it that way.