Search code examples
excelvbasdkpdf-generationadobe

VBA reference filepath defaults to the wrong filepath


I picked up VBA about a month ago but I've gotten pretty comfortable with it. right now I am trying to export excel data into a pdf with specific fields but that isn't my issue... yet. I cannot get VBA to recognize the correct acrobat.tlb file.

I have no idea what to do and from the research I have done I have been unable to find a solution. This is an issue I have been having for multiple days. I have restarted my computer, excel, adobe. I don't know what to do.

Any help is appreciated.

I am on a work computer which had both Acrobat 2020 Standard and Acrobat Reader installed. From what I looked up I figured that VBA was trying to use Acrobat Reader instead of Acrobat Standard because it kept giving me the "no such interface" error. I deleted Acrobat Reader completely from the computer and recycle bin. But, whenever I select the correct acrobat.tlb file it changes the filepath to the incorrect file which now doesn't even exist. The file associated with Acrobat Reader was in Program Files and the one associated with Acrobat Standard was in Program Files (x86). I can select the correct file from the references window but as soon as I reopen the references window it changes the filepath. I have used a macro to delete the reference from the References list but it will still revert back to the wrong filepath after reopening the references window after I have selected the correct file.

Filepath when choosing file: C:\Program Files (x86)\Adobe\Acrobat 2020\Acrobat\acrobat.tlb enter image description here

Filepath after reopening reference window: C:\Program Files\Adobe\Acrobat DC\Acrobat\acrobat.tlb enter image description here

A box allowing me to select the correct filepath remains at the bottom of the References list but selecting doesn't do anything.


Solution

  • Ok so,

    My problem was that I was running 64-bit Excel and a 32-bit version of Acrobat Standard. My computer was smarter than me and was trying to find a 64-bit version of acrobat.tlb which is why it kept creating a filepath to Program Files (which is for 64-bit programs) and not Program Files (x86) even though it didn't exist. I fixed this problem by reinstalling Office in its 32-bit form.

    Hope this is helpful for anyone else struggling with the same problem.