Hi everyone,
I'm in a bit of a pickle...
I've got a VBA script that was working just fine... until I added the following lines:
data.xlsm is a publicly shared file. It is not a read-only file.
I'm getting a random error that says:
with the second line.
And this is despite me using the error handler!
This error doesn't occur most of the time the script is run, only may 1 out of 10 times.
And this error occurs sometimes on my computer, sometimes on another computer, but never the same computer.
Removing these two lines solves the problem.
And everything was perfectly fine before I added these two lines.
I couldn't replicate the error because it comes on randomly.
Can somebody tell me what could be the problem here??
I'm thinking:
1. Is it something to do with the code? I have debugged every component of those 2 lines and the error doesn't change.
2. Is it something to do with the clashing versions of excel between different computers?
3. Is it something to do with individual computer quirks?
4. Is it something to do with just excel being buggy?
5. Is it something to do different versions of Windows excel was installed on?
6. What could it be?
I'm in a bit of a pickle...
I've got a VBA script that was working just fine... until I added the following lines:
Code:
On Error GoTo here
find_row = Workbooks("data.xlsm").Application.Match(Workbooks("data.xlsm").Sheets("Data").Cells(1,2), Worksheets("Data5").Range("A:A"),0)
Workbooks("data.xlsm").Sheets("Data5").Cells(find_row,3) = "New data"
here:
'Code continues on... bla bla bla'
data.xlsm is a publicly shared file. It is not a read-only file.
I'm getting a random error that says:
Code:
"Runtime error 13: Type mismatch
And this is despite me using the error handler!
This error doesn't occur most of the time the script is run, only may 1 out of 10 times.
And this error occurs sometimes on my computer, sometimes on another computer, but never the same computer.
Removing these two lines solves the problem.
And everything was perfectly fine before I added these two lines.
I couldn't replicate the error because it comes on randomly.
Can somebody tell me what could be the problem here??
I'm thinking:
1. Is it something to do with the code? I have debugged every component of those 2 lines and the error doesn't change.
2. Is it something to do with the clashing versions of excel between different computers?
3. Is it something to do with individual computer quirks?
4. Is it something to do with just excel being buggy?
5. Is it something to do different versions of Windows excel was installed on?
6. What could it be?