Hi Froum
Hope someone here can help me out on this one! We are currently migrating our machines from XP/Office2003 to Win7/Office 2010. A problem I am having very frequently is this line of code is not working reliably any more:
The variables are declared and valid, the path and filename are valid. If the path is on a WinXP machine, the code will work 100% of the time. If the path is on a Win7 machine (even if the code itself is being run on XP) then it is very unrealiable, and often (but not always) gives a run-time error Bad Name or File Number. In debug mode, if I simply change the path to an XP machine it will work, confirming the file name and number are both valid.
As a workaround, in one spreadsheet I have set up a loop that keeps trying until eventually it opens. I keep count of how many times it tries - here are some sample values: 35,706 tries, 107,599 tries, 65,489 tries, 158,725 tries.
My only guess it that there is some kind of permissions issue, but then if that were the case I would expect it to never work. In any case, I have admin rights, and the problem also occurs when logged in as administrator.
Any thoughts?
Bookmarks