Solved

vba DOS syntax image convert

Posted on 2014-09-12
6
263 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 48

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 48

Expert Comment

by:Rgonzo1971
ID: 40319083
have you tried my last version
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 48

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now