Solved

vba DOS syntax image convert

Posted on 2014-09-12
6
273 Views
Last Modified: 2014-09-12
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?
0
Comment
Question by:HKFuey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40319068
Hi,

pls try

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


Regards
0
 

Author Comment

by:HKFuey
ID: 40319076
Hi Rgonzo, I still get the error with that syntax.
0
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 40319083
have you tried my last version
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 40319094
pls try to lauch the programm only

RetVal = Shell("C:\Program Files (x86)\TotalImageConverter\ImageConverter.exe")
0
 

Author Comment

by:HKFuey
ID: 40319102
Sorry:
RetVal = Shell("C:\Program Files (x86)\TotalImageConverter\ImageConverter.exe C:\Temp2\myfile.jpeg C:\Temp2\myfile.png")
DOES WORK!
0
 

Author Closing Comment

by:HKFuey
ID: 40319189
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question