I'm still quite new to VBA.
I have created this Subroutine which is called upon in another Sub.
The idea of it, is to search for the cell which contains "<Config Version=" and then select the cell next to it.
This cell is then updated with the latest version number.
Now this sub works perfectly fine as long as I have the "Hidden" worksheet open when I run it. If I attempt to run it whilst any other worksheet is open then it gives me the error:
Run-time error '1004':
Select method of Range class failed
I know I could probably solve this by just selecting the worksheet first, but I feel like that doesn't really address the problem.
The line highlighted is where I get the error, I've been told it's best to avoid using 'Select' and I believe this may be what's causing my error, but I'm not sure how else to go about selecting that specific cell.
Any help appreciated.
Thanks in advance.
I have created this Subroutine which is called upon in another Sub.
The idea of it, is to search for the cell which contains "<Config Version=" and then select the cell next to it.
This cell is then updated with the latest version number.
Now this sub works perfectly fine as long as I have the "Hidden" worksheet open when I run it. If I attempt to run it whilst any other worksheet is open then it gives me the error:
Run-time error '1004':
Select method of Range class failed
I know I could probably solve this by just selecting the worksheet first, but I feel like that doesn't really address the problem.
The line highlighted is where I get the error, I've been told it's best to avoid using 'Select' and I believe this may be what's causing my error, but I'm not sure how else to go about selecting that specific cell.
Any help appreciated.
Thanks in advance.