Runtime 5152

S

slickdock

I'm suddenly getting this error on my development app:

Runtime 5152
application defined or object defined error
Debug highlights:
If .RecentFiles(y).Path = TmpPath Then

....from this routine:

Dim y As Long
With wd
For y = .RecentFiles.Count To 1 Step -1
If .RecentFiles(y).Path = TmpPath Then
If .RecentFiles(y).Name = "merge_ad.doc" Then
.RecentFiles(y).Delete
End If
End If
Next
End With

This is part of a routine that saves query results into a wordmerge format
and opens the txt file in word. This code is to remove it from the recent
files list. If I comment out this section, all runs fine.
It's been running fine for a long time. Not sure what I might have
introduced to kill it. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top