Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

vba DOS syntax image convert

Posted on 2014-09-12
6
Medium Priority
?
276 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
  • 3
  • 3
6 Comments
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 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 53

Expert Comment

by:Rgonzo1971
ID: 40319083
have you tried my last version
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 53

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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.
Suggested Courses

782 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