Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2015, 10:26 AM
troylparrish troylparrish is offline Adding AddIn with VBA stops recognizing file path Windows 7 32bit Adding AddIn with VBA stops recognizing file path Office 2010 32bit
Novice
Adding AddIn with VBA stops recognizing file path
 
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
  #2  
Old 10-08-2015, 08:29 PM
macropod's Avatar
macropod macropod is offline Adding AddIn with VBA stops recognizing file path Windows 7 64bit Adding AddIn with VBA stops recognizing file path Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Since you've identified an issue with the user profiles, it is unlikely changing anything in the code or even an Office setting would resolve it. That said, you might try repairing the Office installation (via Start > Windows Control Panel > Programs > Programs & Features > Microsoft Office (version) > Change>Repair).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-20-2015, 05:16 AM
troylparrish troylparrish is offline Adding AddIn with VBA stops recognizing file path Windows 7 32bit Adding AddIn with VBA stops recognizing file path Office 2010 32bit
Novice
Adding AddIn with VBA stops recognizing file path
 
Join Date: Oct 2015
Posts: 2
troylparrish is on a distinguished road
Default Resolution Found

Thank you Macropod for your reply. Unfortunately the solution you suggested did not fix the problem. What did fix the issue was opening a blank word document and then via the Word's own Add-In functionality add the document. Close the blank document and then run the vba code. This works even after completely closing word, the user logging out and even after a reboot. File => Options => Add-Ins => Word Add-Ins (From Drop Down Menu) => Add Button on Popup dialog.
Reply With Quote
Reply

Tags
addin, vba can't find file



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding AddIn with VBA stops recognizing file path Separating path from file name KBo Word 4 03-11-2015 01:45 PM
Adding AddIn with VBA stops recognizing file path Adding additional "\" to directory path name jmaxcy Excel 1 10-15-2013 01:42 PM
Adding AddIn with VBA stops recognizing file path When opening a file, Word stops responding. bTaryag Word 9 10-25-2011 09:39 AM
Adding AddIn with VBA stops recognizing file path get file name without Path Ziggy1 Word VBA 1 09-29-2006 07:55 PM
Not Recognizing Contacts cehdcs Outlook 0 02-06-2006 02:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft