Solved

vba DOS syntax image convert

Posted on 2014-09-12
6
271 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 50

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 50

Expert Comment

by:Rgonzo1971
ID: 40319083
have you tried my last version
0
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!

 
LVL 50

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

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.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

756 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