# Microsoft Office Application Help - Excel Help forum > Excel Programming / VBA / Macros >  >  [SOLVED] Run time error 75 (Path/File Access Error)

## Riggers

This worksheet uses an OnTime event to check for the presence of an text file every 8 seconds and then read in the contents.  I've checked everthing but can't figure out why it's crashing on my XP laptop but works fine on Win7.  I just get a message saying excel needed to close...

I've checked all the code to look for obvious signs of a memory leak but can't find any objects I'm not destroying properly.  I checked memory usage on task manager and it does increase a little over time but the crash happens way before any memory gets used up.

Bpth machines are running Office 2007 Home & Student.  The XP Machine is a little Sony Vaio notebook with a 1.06 ghz processor and 1GB RAM whereas the Win7 laptop is a much faster beast, although nothing is telling me its a performance issue.  On the notebook I use tuneup utilities to get it running pretty well.

On Opening you have to click the Live Score option to start the timer. Before that the path on Settings B28/B29 needs to be any valid folder on your machine.  It just looks for the presence of a file called score.flg and takes no further action if it can't find it.

If anyone could take a look and offer some advice I'd really appreciate it.

----------


## Riggers

I should also say the crash happens even when there is no file found by the code called by the timer so the code which would open and read in the file is not even being called.

----------


## Riggers

I've done some more troubleshooting on this and I now think the problem is related to the display of one of the user forms.  I'm seeing an intermittant problem whereby it displays File/Path Access Error and you are unable to bring the form up in VB editor.  Closing the worksheet and reopening fixes it but eventually the problem comes back.  The file is being launched from the desktop, not a network share or anything and I can't think of any reason for this strange message.  Google hasn't been much help either.  Anyone have any ideas why this could be happening?

----------


## snb

I don't see any checking of any file in the .ontime macro.
It only contains 'calculate'

----------


## Riggers

After a lot more investigating I've now found this is nothing to do with the ontime routine.  It's a little known bug affecting Excel 2007 workbooks containing user forms.  After being open for a while the workbook generates a Run Time Error 75 (Path/File Access Error).  Shortly after this the workbook would crash.  My code was failing because the ontime routine was saving the workbook periodically and any attempt to save the workbook after the path/file access error instantly causes the workbook to crash.

The problem seems to be specific to Excel 2007 and I've found one affected user suggesting an upgrade to 2010 fixed it for them.  Most people affected seem to say it only happens on XP (me included) but worryingly someone has also reported it on Win7.

There is no known fix for Excel 2007 users.  Someone advised you could hide user forms instead of unloading them but that didn't work for me.  I've tried everything to make it work but am finally giving up.  I'll change the thread title to better reflect the issue.

----------


## OnErrorGoto0

Where is the evidence that this is a bug, rather than a code error?

----------


## Riggers

Here is a link to the best thread I found on the subject:  

http://www.pcreview.co.uk/forums/use...-t3944734.html

----------


## OnErrorGoto0

That was a trial version of Excel 2007. Hardly definitive evidence of an ongoing bug.  :Wink:

----------


## OnErrorGoto0

FWIW though, for any intermittent code errors, I would generally recommend cleaning your workbook (using Code Cleaner) or even rebuilding it in a new workbook.

----------


## Riggers

> That was a trial version of Excel 2007. Hardly definitive evidence of an ongoing bug.



Personally I think the evidence is pretty good.  In that thread instructions were given as to how to recreate the problem in a new workbook and another user was able to do exactly that.  I've already tried recreating my workbook myself from a new workbook and new user forms and the problem is still there.  In all my research on the Run Time 75 Path/File Access error over the last few days all I have found is confusion and frustration from people and no fixes being found by any of them.

----------


## OnErrorGoto0

You've shown a few people experiencing an intermittent issue, but you yourself have it working in Excel 2007 on a different machine, which would imply to me that if there is a bug, it is not necessarily in 2007. It may be an issue with the OS, or a hardware conflict.

Don't get me wrong - Excel 2007 is a buggy piece of **** in my opinion and I try never to use it, but I am not convinced that that is where this bug lies. (I note the coincidence of one user in that thread mentioning the error occurring after his screensaver kicked in for instance)

----------


## Riggers

> You've shown a few people experiencing an intermittent issue, but you yourself have it working in Excel 2007 on a different machine, which would imply to me that if there is a bug, it is not necessarily in 2007. It may be an issue with the OS, or a hardware conflict.
> 
> Don't get me wrong - Excel 2007 is a buggy piece of **** in my opinion and I try never to use it, but I am not convinced that that is where this bug lies. (I note the coincidence of one user in that thread mentioning the error occurring after his screensaver kicked in for instance)



I think we will have to agree to disagree on this.  In my opinion this is a bug that's been found in Excel - they (different users) even recreated it with a simple new workbook with one form and one line of code.  If a hardware conflict or an OS issue is causing Excel to do this (which I personally think is unlikely) then it is still a bug in Excel in my mind.

More to the point - can anyone offer any suggested fixes other than those already mentioned?

----------


## OnErrorGoto0

It's more likely to be a bug in the Forms Library (FM20.dll) which is not actually part of Excel, I would suggest, but never mind. If it's not related to OS or hardware, why does it work on one of your machines?

The only other thing I can suggest that you might try is not using the default instancing of the forms - declare a variable and use that, then destroy the variable when done.

----------


## Riggers

> It's more likely to be a bug in the Forms Library (FM20.dll) which is not actually part of Excel, I would suggest, but never mind. If it's not related to OS or hardware, why does it work on one of your machines?
> 
> The only other thing I can suggest that you might try is not using the default instancing of the forms - declare a variable and use that, then destroy the variable when done.



I'm not saying it's not related to OS or Hardware, I'm just saying Excel seems to behave differently on a Win7 machine to an XP machine, but I still say this is a bug in Excel.  Anyway, that's just pedantics really.

Thanks for the suggestion.  I tried creating a new instance of the form then destroying it afterwards, I even tried not loading any of the forms at all (commented out all lines with .show) but the very fact the forms exist in the workbook seems to be enough to crash it.  

When I get home tonight I'm going to try and recreate the simple workbook and single userform described by those other users to see if that errors too, although I'm not sure what extra knowledge that is going give me.  I've tried repairing Excel too.  I hate to be beaten but it looks like I have been on this occassion.

----------


## OnErrorGoto0

> I'm not saying it's not related to OS or Hardware







> If a hardware conflict or an OS issue is causing Excel to do this *(which I personally think is unlikely)*



Did I misunderstand that then?  :Confused: 





> the very fact the forms exist in the workbook seems to be enough to crash it



That would appear to be a whole new issue, or were you testing this in the same session where you had already shown the form(s)?

Also, just to check, when you say "I tried creating a new instance of the form then destroying it afterwards", can you specify the code you used, please?

If you can show this to be a replicable bug (a demo workbook would be ideal) under a specific OS, then I will file it as a bug, though I cannot make any promises that MS will pay attention.

----------


## Riggers

Yes I think you did misunderstand... The word 'unlikely' is the key  :Wink: 

Any testing I've done on various potential solutions has always involved closing and reopening Excel.

I don't have teh code available to me now as I'm at work but I displayed a new instance of the form something like this:



```
Please Login or Register  to view this content.
```


Then in the form itself there is a close button which invokes:



```
Please Login or Register  to view this content.
```


I'll try and post a simpler version of the workbook so others can try and recreate the bug.

----------


## OnErrorGoto0

So you were running that from a form? How did you load the original form?

----------


## Riggers

> So you were running that from a form? How did you load the original form?



No I was running the first part of code mentioned above from a sub routine triggered by OnTime.  Then in the form itself the close button was used to unload it.  there was no other functionality or buttons in the form - it's just like a pop up reminder (modeless so the workbook can carry on functioning) with a close button in it.

----------


## Riggers

So what i'm saying is.... rather than use formname.show I was using the code above to create a new object and then show that, which would potentially allow mutiple instances of the same form to be shown simultaeneously.

----------


## Riggers

But.... remember - even without ever showing any form in this worksheet I was still getting the error / crash after a (variable) period of time.  Removing the forms completely is the only way I've found of solving this.

----------


## OnErrorGoto0

So to what does Me refer in the



```
Please Login or Register  to view this content.
```


?

What I actually meant was more like:



```
Please Login or Register  to view this content.
```

----------


## Riggers

The form name is "FacebookForm" and from memory the line of code was UserForms.Add("facebookForm")

I'm guessing so will post the actual code later tonight and hopefully a simple version if I can recreate it.

----------


## OnErrorGoto0

Having had a look through your forms, one thing I would recommend is not binding them directly to ranges - ie do not use ControlSource, Rowsource. Use code to read/write to and from the worksheets.

----------


## Riggers

> Having had a look through your forms, one thing I would recommend is not binding them directly to ranges - ie do not use ControlSource, Rowsource. Use code to read/write to and from the worksheets.



First of all, thanks very much for taking the time to help, it's really appreciated.

When I first started looking at this I did think ControlSource might be the issue so I deleted them all then reapplied them but without saving in between.  I'll try what you say i.e. delete all the ControlSource references and then, before applying any code to update the cell values, I'll see if it errors.  Good thinking  :Smilie:

----------


## OnErrorGoto0

It's the only way I can see an _unloaded_ form being the cause of the crash.

----------


## Riggers

I made a new version of the workbook with all the forms containing ControlSource links removed and left the other forms intact.  It crashed again after around 10 minutes.  I don't have time tonight to post a simple version you can use to try and replicate but I will do as soon as I can.

----------


## OnErrorGoto0

Well I have just left the workbook you posted open in 2007 on XP (in a VM but that shouldn't matter) with no issues.

----------


## Riggers

> Well I have just left the workbook you posted open in 2007 on XP (in a VM but that shouldn't matter) with no issues.



Interesting... did you display any forms or start the OnTime?  Were you able to save the workbook at the end?

----------


## OnErrorGoto0

No, I simply opened it, enabled macros and left it. Was that not what you were doing? Didn't try and save it as I hadn't made any changes.
Can test other scenarios later on if you specify them?

----------


## Riggers

> No, I simply opened it, enabled macros and left it. Was that not what you were doing? Didn't try and save it as I hadn't made any changes.
> Can test other scenarios later on if you specify them?



I think it would be good to use one or even all of the 4 forms at least once.  As my built in macros will be dependant on certains folders / files being present (and timestamps on them being changed) probably the easiest way to do this would be just to make a new sub with "userform.show false" in it and run that then hit cancel or close when the form shows.  Doing that a few times should be enough for it to error out if left for a while afterwards.

Thanks again for your help.

----------


## OnErrorGoto0

I ran your workbook in XL2007 on Win7 just now - opened a form, started the timers and left it for about an hour then saved and closed with no issue.
Will try and retest in XP again later on.

----------


## Riggers

Thank you.  

After starting the timer (presume you ticked the live score option) did any of the forms pop up?

It works perfectly on Win7 for me too.

----------


## OnErrorGoto0

I clicked one of the buttons to load a form then closed it again.

----------


## Riggers

OK.  When testing on XP make sure the facebook option is ticked as that can cause a different form to pop up and something keeps telling me this is one of the problem ones (don't ask me why).

----------


## Riggers

More info on this...  I made a simple new workbook just like they mentioned in the thread I linked to.  It had 3 sheets and one user form with no controls on it.  I opened and closed the user form 3 times then left the workbook running while I went to work.  When I returned it had crashed.  So clearly Excel 2007 has some problem with this installation but I have no idea what.  It is a fresh install of 2007 home and student running on XP service pack 3.

----------


## OnErrorGoto0

Did you have a screensaver set up, as a matter of interest?

----------


## Riggers

No screen saver running.

----------


## Riggers

Can you think of anything else I can check or try to resolve this?  Otherwise it seems I'm not going to be able to use this installation of Excel with any spreadsheets containing forms.  Excel 2003 worked fine but I've paid for 2007 so don't really want to go back to 2003 and I don't want to have to paid again to upgrade to 2010.  

Its very frustrating and also somewhat surprising there is not more info about this error.

----------


## OnErrorGoto0

I have not yet been able to replicate your issue on 2007 (I don't do Excel stuff at weekends - unless it's paid work - as it is more than my life is worth!)
Probably cheaper to upgrade your OS though.  :Wink:

----------


## Riggers

Unfortunately upgrading my OS is not a viable option on a vaio notebook with only 1.06 Ghz CPU and 1GB Ram.  I might have to downgrade Excel to 2003 and make a 2003 compatible version of this workbook, which does hurt after paying out for 2007 and building it in that version  :Frown:

----------


## OnErrorGoto0

It wasn't a serious suggestion...

I will test again later on. I doubt that it can be easily replicated though or there would, I think, be far more reports of it. There must be a specific set of conditions that apply (especially given the huge use of WinXP in corporate environments)

----------


## Riggers

> It wasn't a serious suggestion...
> 
> I will test again later on. I doubt that it can be easily replicated though or there would, I think, be far more reports of it. There must be a specific set of conditions that apply (especially given the huge use of WinXP in corporate environments)



Yes I agree, it's really strange.  I can't think what could be causing it as (being a small laptop for occassional use) it's not been subject to much activity in terms of hardware / software additions and has had regular windows updates, AV sweeps etc.  I'm not sure if I ran any office update after installation of 2007 though so I'll try that when I get home.

----------


## OnErrorGoto0

Definitely worth doing. You absolutely cannot work with 2007 without at least SP2 installed.

----------


## Riggers

I had no idea until I thought about it today that a new download could need a further update but it did and I now have 2007 SP3 and cant recreate the problem.  Thanks for all your help.

----------


## OnErrorGoto0

I do like a happy ending.  :Smilie:

----------

