Jaymond Flurrie
Well-known Member
- Joined
- Sep 22, 2008
- Messages
- 921
- Office Version
- 365
- Platform
- Windows
I have a problem with file locations of Excel. Depending on what computer I use, the Excel (and Word for that matter) is located either at C:\Program Files (x86)\Microsoft Office\ or at C:\Program Files\Microsoft Office\
The problem this causes is that when I create a reference to one file location, the other link "breaks" ie. VBA can't find Excel (or Word) anymore because it's simply not there.
Could I fix this somehow by coding the add reference to VBA so that I could make something like
(and yes, I know the above code doesn't work, but it should give you the idea of what I would be looking for)
The problem this causes is that when I create a reference to one file location, the other link "breaks" ie. VBA can't find Excel (or Word) anymore because it's simply not there.
Could I fix this somehow by coding the add reference to VBA so that I could make something like
Code:
Dim WordRef as reference
if Wordref = broken then
Wordref.location = application.location & "\winword.exe"
endif
end sub
(and yes, I know the above code doesn't work, but it should give you the idea of what I would be looking for)
Last edited: