View Single Post
 
Old 10-08-2015, 10:26 AM
troylparrish troylparrish is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Oct 2015
Posts: 2
troylparrish is on a distinguished road
Default Adding AddIn with VBA stops recognizing file path

Hello,

I am adding an AddIn through VBA in the follow manner:
Code:
 
 
sDirectory = "C:\directory\"
    sFilePath = sDirectory & "AddInFile.dot"
AddIns.Add FileName:=sFilePath, Install:=True
This works for most of my users, but a couple have had a problem with Word not being able to locate the file resulting in an error. The interesting part is that it worked for these users for 6 to 8 weeks and then stopped working.

Additionally, if I rename the file and change the file path in the VBA, Word then can find the file. I have googled this one for about a week with no luck. If I run the following code:

Code:
 
If Len(Dir(sFilePath)) = 0{
    MsgBox "File Does not exist"
Else
    MsgBox "File Exists"
End If
VBA says the file is there.

Also, another user can log into the specific machine and the application works as expected, so the issue seems to be confined to the users specific Word files under their account. One user reimaged their machine and the problem went away but this is not a valid solution for obvious reasons.

Is there a cache in word (other than recent files, recent places) that can be cleared to help Word find the file or some solution to this particular issue?

Thanks in advance for any help.

Last edited by troylparrish; 10-08-2015 at 10:43 AM. Reason: Clarifying Code
Reply With Quote