ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   save txt file (https://www.excelbanter.com/excel-programming/272342-re-save-txt-file.html)

Domagoj Vulin

save txt file
 

"Hank Scorpio" wrote in message
...
On Tue, 22 Jul 2003 13:23:19 +0200, "Domagoj Vulin"
wrote:

I'm VBA newbie and trying to save .txt file from Excel. The problem is

that
it saves it in root of current active drive (in my case it is E:)
How can I get the folder where workbook is saved, something like
Server.MapPath in ASP?


ActiveWorkbook.Path will give you the path of the active workbook.
However if the workbook hasn't been saved, it will return an empty
string.


Thanks, that's what I needed

Second problem - is it possible to run exe application from excel?
The point is that i have old fortran application, so I want to save input
data from excel to txt file, execute fortran application which saves the
output into output txt file and then, at last open from Excel macro that
output file and parse it to spreadsheet.


See on-line help for the Shell function, a summary of which is below:
--------------------------------
Shell Function

Runs an executable program and returns a Variant (Double) representing
the program's task ID if successful, otherwise it returns zero.

Syntax

Shell(pathname[,windowstyle])
---------------------------------

---------------------------------------------------------


Now I have to try this...




All times are GMT +1. The time now is 10:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com