Hello everybody,
I've just started with Access and some coding around it. Right now, I'm trying to deal with my first issue, which I would like to approach you with.
I'm trying to put together some copying tool, copying the data from Excel to Access. My code is currently working as long as the "DoubAmount" is a number. Unfortunatelly, there are also the cells containing text in my Excel sheet I source the data from. At the point, when macro reaches these cells (there is a loop going cell by cell through the row), it breaks down. The error message says:
Run-time error '13':
Type mismatch
Would you have by chance any idea, how to redefine the variable "doubAmount" to enable copying over both number and text data? Or where else could be a problem? I've tried to replace the "Double" by "Variant", but it wasn't working either.
I will post here only the parts of the code, that I'm working with at the moment and I consider crucial.
First, I've got the declaration of variables:
Then, I've defined ranges with the data and stored all of the data into globalXLSmax:
("globalXLSdata(i).doubAmount = vAmount(i, 1)" is referenced by debugger as a source of the breakdown")
globalXLSdata is then later referenced when I "INSERT INTO" the data into the Access:
Thank you for any help!
Bookmarks