PSN-L Email List Message

Subject: Re: Quake data spreadsheet
From: Larry Conklin lconklin@............
Date: Sat, 24 Oct 2009 09:22:37 -0400


Hi Setephen,

Below is a copy of the macro, cut & pasted right out of the spreadsheet. 
  The basic idea is to use the VBA Shell() function to call an external 
program and pass the name of the file to be executed as a command line 
argument.  You could do this with most anthing, provided that the 
program you pick expects command line arguments.  Take note that some of 
the lines in the code got folded to fit this e-mail.  (Ie. DataFilePath 
=.... , ExecutablePath = ... , ProcID = ...)

If you want to try it out I'd be happy to send you a copy of the whole 
thing, along with a little file of "user notes" that I put together.

One little Winquake enhancement I'd love to see (hint, hint) is the 
capability to take more than file name argument on the command line. 
You can already select more than one file in the file open dialog box, 
and if the files are compatable (same time parameters) they open 
together, which allows direct comparison and manipulation of the two 
files.  If I use my spreadsheet to open more than one file, both open in 
their own windows in Winquake, but any manipulations in one file window 
do not affect the other.

Larry


Sub RunWinquake()
'
' Pass a selected event file to Winquake for execution.  The
' event file is selected by selecting the event file name in
' the spreadsheet.
'
Dim ProcID
Dim DataFilePath    As String
Dim ExecutablePath  As String

DataFilePath = Environ("WQPATH") & Range("Notes!D20").Value &
Left(ActiveCell.Value, 2) & "\"
ExecutablePath = Environ("WQPATH") & Range("Notes!D23").Value

ProcID = Shell(PathName:=ExecutablePath & " " & DataFilePath & 
ActiveCell.Value, WindowStyle:=vbNormalFocus)

End Sub

Stephen Hammond wrote:
> This sounds like something I would like to try, do you mind sharing the
> excel macro?
> Steve Hammond  PSN Aptos, CA
> 
__________________________________________________________

Public Seismic Network Mailing List (PSN-L)


[ Top ] [ Back ] [ Home Page ]