In my datbase, I have a form that is linked to a table. I want to read a cell value in an excel 97 spreadsheet, and assign it to a text box in the access form, so it will be added to the access table automatically.
The form has a text box that lets me input the excel filename, and another one that will have the sheet name. The value will allways be read from cell “e21”. (format: number, fixed 2 decimals)
The excel file will be open at the moment of doing the operation.
I need the code to assign the value to my text box, for example:
Text1 = workbooks (“filename.xls”).worsheets(“sheetname”).Range(“e21”).Value
(Itried that , but it yields an error message)
I already have a commandbutton, that when clicked, will run the subroutine.
Thanks for the help!!!