vba DOS syntax image convert

When in DOS I can:
cd C:\Program Files (x86)\TotalImageConverter\

Then I type:
ImageConverter.exe Temp2\myfile.jpeg C:\Temp2\myfile.png and my file is converted to a png using the ImageConverter software

I tried Access: Shell (cmd.exe & "C:\Program Files (x86)\TotalImageConverter\ImageConverter.exe C:\Temp2\myfile.jpeg C:\Temp2\myfile.png")
I get error 424 "Object Required"

Does anyone know how to make this work?
HKFueyAsked:
Who is Participating?
 
Rgonzo1971Connect With a Mentor Commented:
Hi,

pls try

RetVal = Shell("C:\Program Files (x86)\TotalImageConverter\ImageConverter.exe C:\Temp2\myfile.jpeg C:\Temp2\myfile.png")


Regards
0
 
HKFueyAuthor Commented:
Hi Rgonzo, I still get the error with that syntax.
0
 
Rgonzo1971Commented:
have you tried my last version
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Rgonzo1971Commented:
pls try to lauch the programm only

RetVal = Shell("C:\Program Files (x86)\TotalImageConverter\ImageConverter.exe")
0
 
HKFueyAuthor Commented:
Sorry:
RetVal = Shell("C:\Program Files (x86)\TotalImageConverter\ImageConverter.exe C:\Temp2\myfile.jpeg C:\Temp2\myfile.png")
DOES WORK!
0
 
HKFueyAuthor Commented:
Thanks very much.

The finished code uses a parameter '-fo' to overwrite the converted file if existing: -
Dim Retval As Variant
Dim strPath As String
'Convert jpeg to bmp
strPath = "C:\Program Files (x86)\TotalImageConverter\ImageConverter.exe" & " C:\Temp2\" & Dnote & ".jpeg" & " C:\Temp2\" & Dnote & ".png" & " -fo"
Retval = Shell(strPath)
0
All Courses

From novice to tech pro — start learning today.