Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default run exe program and locate current workbook

I have 2 questions:
1. how can I determine the current working folder of a XLS file with a
macro? GetAbsolutePath didn't give me the best results...
2. is it possible to run .exe program from a VBA macro and how?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default run exe program and locate current workbook

Use ThisWorkbook.Path to get the full path name of the workbook.
Use CurDir to get the current default path. You can run an exe
file by using the Shell command. See help for more details.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Domagoj Vulin" wrote in message
...
I have 2 questions:
1. how can I determine the current working folder of a XLS file

with a
macro? GetAbsolutePath didn't give me the best results...
2. is it possible to run .exe program from a VBA macro and how?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default run exe program and locate current workbook


"Domagoj Vulin" wrote in message
...
I have 2 questions:
1. how can I determine the current working folder of a XLS file with a
macro? GetAbsolutePath didn't give me the best results...


What do youmean by this ?


2. is it possible to run .exe program from a VBA macro and how?



Yes , you can use the shell function

Progid = Shell(pathname[,windowstyle])

Progid is a variable of type double and the returns
the process ID if it works or 0 otherwise

pathname - Required String holding the name of the program to execute and
any required arguments or command-line switches; may include directory or
folder and drive.

windowstyle - Optional integer defining style of window in which program
is run , use one of the intrinsic constants

vbHide0
vbNormalFocus
vbMinimizedFocus
vbMaximizedFocus
vbNormalNoFocus
vbMinimizedNoFocus6

Note the program executes asynchronously, that is VBA
does NOT wait for it to complete before carrying on.

Keith


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quickly locate a specific page/tab in workbook touchstone Excel Discussion (Misc queries) 4 January 1st 10 05:04 AM
Locate Workbook Kev Excel Discussion (Misc queries) 2 December 28th 06 04:07 PM
Addon program for excell to locate muliple entries in a list stef Charts and Charting in Excel 0 May 19th 06 01:25 PM
How do you locate External References in an Excel Workbook Iain Excel Discussion (Misc queries) 2 February 3rd 05 01:05 AM
How do I program a cell to automaticinput the current date as dat. ces Excel Worksheet Functions 1 November 8th 04 11:11 PM


All times are GMT +1. The time now is 02:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"