Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 25th, 2004, 01:13 AM
Authorized User
 
Join Date: May 2004
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Function to run an executable

I hate to ask with such a basic issue........too many hours, gotta take a break.....

I would appreciate a sample function to run an executable program using VB code. I think it may look something like this, but this does not work. Just using WinZip as an example, but typical of any program that will accept switches/parameters.


Quote:
quote:Sub ZipCompress(ZipFile,FilesToZip)
'ZipFile = Path and filename for the zipped file
'FilesToZip = List of files to zip

dim strParameters as String

Parameters ="[-min] -a " + ZipFile + " " + FilesToZip

Execute "C:\Program Files\Winzip\WINZIP32.EXE" strParameters

End Sub
 
Old June 25th, 2004, 02:10 AM
Authorized User
 
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This will not work friend...
Quote:
quote: Execute "C:\Program Files\Winzip\WINZIP32.EXE" strParameters

use simple because Simplicity is the best Beautiy :D;)
Private Sub Command1_Click()
    Shell "E:\Winnt\system32\RUNDLL32 SHELL32.DLL,Control_RunDLL NCPA.CPL,@0,2"End Sub


Hope it will help you alot...:D :)

Stay Beautiful,
Abdul Salam





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run a .js file from a javascript function sbkumar Javascript How-To 1 July 11th, 2008 11:12 AM
run some function when cache reached to limit valu Maxxim ASP.NET 2.0 Professional 9 October 15th, 2007 12:46 PM
iis didn't run function qs ASP.NET 1.0 and 1.1 Basics 1 June 14th, 2006 02:47 PM
Creating an executable Arsi C# 1 November 9th, 2004 06:45 PM
run function from UserControl melvik C# 11 August 6th, 2003 08:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.