1 Reply Latest reply on Jan 9, 2013 11:51 PM by sanjeevgcom

    Unable to export image (saveforweb) using VBScript

    sanjeevgcom Level 1

      I'm writing a PS CS5 VBScript that excecutes as a Macro from MS Excel, opens an image file, resizes it and saveforweb as PNG file. Everything seems to be working fine except when the scripts executes ExportDocument, it throws an error "Object doesn't support this property or method"


      Set appRef = CreateObject("Photoshop.Application")    

      Set saveOptions = CreateObject("Photoshop.ExportOptionsSaveForWeb")    

      Set img = appRef.Open("c:\image.png")         

      saveOptions.Format = 13 'psPNGSave    

      saveOptions.PNG8 = True    

      saveOptions.Transparency = True    

      saveOptions.Dither = psNoDither      

      img.ResizeImage 620, 620    

      img.ExportDocument "c:\image2.png", 2, saveOptions


      Any ideas where I might be going wrong .. ??