Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript runtime error: ActiveX component can't create object: 'Photoshop.JPEGSaveOptions'

Status
Not open for further replies.

Mark_S

Programmer
Nov 24, 2020
3
0
0
GB
I've been running a suite of VBScripts with Photoshop CS5.1 for years but recently replaced my motherboard and I'm having a problem getting my scripts going again after rebuilding the machine.

To isolate the problem, I've been trying the following test script taken from the Photoshop CS5.1 scripting guide:

1> Dim appRef, docRef, jpgSaveOptions
2>
3> Set appRef = CreateObject("Photoshop.Application")
4> Set docRef = appRef.Documents.Add()
5>
6> Set jpgSaveOptions = CreateObject("Photoshop.JPEGSaveOptions")
7>
8> jpgSaveOptions.EmbedColorProfile = True
9> jpgSaveOptions.FormatOptions = 1 'for psStandardBaseline
10> jpgSaveOptions.Matte = 1 'for psNoMatte
11> ...

As it's 32bit I run it using c:\SysWoW64\cscript.exe

After the clean install of Windows 10 this wouldn't work (as expected) with an ActiveX Can't create object error, so I started the ActiveX Installer (AxInstSV) service and set its startup type to automatic and rebooted the machine.

The test script now runs, opens Photoshop OK and opens a new document but then fails when it gets to JPEG save options with:

test.vbs(6, 1) Microsoft VBScript runtime error: ActiveX component can't create object: 'Photoshop.JPEGSaveOptions'

So it can create the Photoshop.Application object but not the Photoshop.JPEGSaveOptions object. Does anyone have any ideas why that might be?!
 
2020-11-24_hahmvu.png


I've made some progress. In the registry, there's only an entry for the class Photoshop.JPEGSaveOptions.55 rather than Photoshop.JPEGSaveOptions and if I change the script above to

6> Set jpgSaveOptions = CreateObject("Photoshop.JPEGSaveOptions.55")

then it works. I can only assume that because I originally ran the scripts on Photoshop CS2 that there were some legacy entries in the registry in my old system build but on the new system it's only ever been run on a new install of Photoshop CS Design Standard 5.5.

So the question now is - should I update all of my scripts or try to update the registry?

Even though it's more work I'm guessing updating the scripts will be the safer option ;-)
 
Do you have any other versions of Adobe products installed?
 
No (apart from Lightroom 6 which is separate from CS) but it's complicated by the fact that I only have upgrade licences of the software way back to Photoshop 7.0 so it's a pain to install as I have to install and subsequently uninstall at least Photoshop from CS and CS2 in order to arrive at my CS 5.5 installation. I'm guessing that the software worked before by picking up something from the registry from CS or CS2 - but I'm not sure!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top