by
pault » Fri Mar 28, 2014 2:46 pm
If you open up the command line and paste the following command then it will load the file:
ldnewfile "C:\Data\10624-002.D",,0
An Idea: If they click on the chromatogram , clear the clipboard and copy the command to the clipboard,
then when they click on the Data Analysis command line and press Cntrl-V, and then Enter, it will load the data file.
If you want to automate it, then you're looking at using DDE, and a world of bugs.
Alex
Alex, thank you very much for your approach.
I have done some progress. I had to study MSD Chemstation macros little bit. I've created my own macro "C:\msdchem\MSexe\EditCompound.mac"...
Code: Select all
NAME LoadFile
LDNEWFILE "C:\Data\10523-006.D"
QEDIT
CO 6
After that I modify the macro "C:\msdchem\MSexe\envinit.mac". At the end of „envorphinit“ procedure I pasted this line of code:
Code: Select all
MACRO _exepath$+"EditCompound.mac",go
I create the macro "C:\msdchem\MSexe\EditCompound.mac" in VBA Excel just before I launch the chemstation:
Code: Select all
Function Write_Macro(ByVal FilePath As String, ByVal Param As String) As Boolean
On Error GoTo ErrorHandler
Open MACRO_FILE_PATH For Output As #1
Print #1, "NAME LoadFile"
Print #1, "LDNEWFILE "; Chr(34) & FilePath & Chr(34)
Print #1, "QEDIT"
Print #1, "CO " & Param
Close #1
Write_Macro = True
Exit Function
ErrorHandler:
Write_Macro = False
End Function
The chemstation I launch in VBA with this code:
Code: Select all
myValue = Shell("C:\msdchem\MSexe\msda.exe 1 ,envorphinit , envinit.mac")
That is it.
Tomas