I'm working on a script which essentially opens an excel document in the background, searches for a cell and returns the co-ords. I've based my script off the one Marcus posted here https://www.mjtnet.com/blog/2010/12/15/ ... -vbscript/, but with one key change. I noticed that Marcus posted a small disclaimer that said the code would not work if multiple instances of Excel were open... Well, that's the case, so I went exploring to https://support.microsoft.com/en-us/kb/288902 and found that instead of using
Code: Select all
Set xlApp = GetObject(,"Excel.Application")
Code: Select all
Set xlApp = GetObject("Book2").Application
when I put this into Macro Scheduler and run it, I receive the following error:
Code: Select all
Macro Scheduler
:-2147221020
Line 11334, Column 4
I've played around with different Excel filetyped (.xlsx, .xlsb, .csv), changed the name to something less complex (no spaces, hyphons, numbers etc) and all the same.
Any ideas?
Thanks in advance, as always,
Dominic Fichera