Skip to main content
Participant
January 13, 2014
Answered

Help, cannot set references to Photoshop.Application in VBA

  • January 13, 2014
  • 1 reply
  • 1877 views

Hello,

I have used CS5 in the past and have had a well-functioning VBA program (running within Access 2010) that ran fine, opens 32-bit Photoshop, and controlled photoshop CS5 normally, allowing me to manipulate photos, read metadata, etc.  (It was my understanding that at least for CS5, scripting programs including VBA needed to run the 32 bit version of Photoshop, not the 64 bit version.)

I installed CS6 about 6 months ago and the VBA program continued to work just fine, provided it still opened the 32 bit version. (I had to be sure I was not running 64 bit Photoshop when I started the VBA program).  CS5 was still installed but not being used.

I just uninstalled CS5, leaving CS6 installed.  For some reason, this left the VBA program disrupted in that the References (which you set in the VBA code window with Tools > References) no longer appear to be valid.  I am unable to set a new Reference to Photoshop.Application and the program has become unusable.  That is, the "Available References" no longer list Adobe Photoshop CS6 Type Library or Adobe Photoshop CS6 Object Library.  I browsed to the the file C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\TypeLibrary.tlb to add this reference manually.  The programs still does not compile (i.e., Dim appRef As New Photoshop.Application  causes an error "User Defined Type not defined").  I get the same failure to compile if I browse to and install a reference to the 32-bit version, C:\Program Files (x86)\Adobe\Adobe Photoshop CS6\TypeLibrary.tlb.  In the past, I also had a reference to the "Adobe Photoshop CS6 Object Library".  I have tried to manually set this to C:\Program Files (x86)\Adobe\Adobe Photoshop CS6\Photoshop.exe or to the 64 bit version of Photoshop.exe, but these files are not accepted and I do not otherwise know the file location of the Object Library. 

I very much need help from someone who knows how to fix this problem in transitioning from CS5 to CS6 for using VBA.

Thank you,

EGibbon

This topic has been closed for replies.
Correct answer Tom Ruark

There are global keys that get overwritten with each version of Photoshop. Photoshop.Application for example gets set for each install of Photoshop. When you uninstalled CS5 those keys got removed.

Can you install CS6 again? You don't need to uninstall. Just install again if it will let you.

I have a script that wil set them but I don't really like to use it on other folks machines as it messes with the registry and I don't want to make it worse for you.

1 reply

Tom Ruark
Tom RuarkCorrect answer
Inspiring
January 13, 2014

There are global keys that get overwritten with each version of Photoshop. Photoshop.Application for example gets set for each install of Photoshop. When you uninstalled CS5 those keys got removed.

Can you install CS6 again? You don't need to uninstall. Just install again if it will let you.

I have a script that wil set them but I don't really like to use it on other folks machines as it messes with the registry and I don't want to make it worse for you.

EGibbonAuthor
Participant
January 13, 2014

Hello Tom

Thank you for this help.  I am happy to report that upon uninstalling CS6 Photoshop (which I did before seeing your advice) and reinstalling it, the VBA app now works fine.

Thanks again.

EGibbon