Advertisement

MSDCHEM load data file

Discussions about chromatography data systems, LIMS, controllers, computer issues and related topics.

7 posts Page 1 of 1
Hi!
I would like to create shortcut or macro, that automatically loads specific datafile.

Now my chemstaion D.03.00.611 is launched by shortcut:
C:\msdchem\MSexe\msda.exe 1 ,envorphinit , envinit.mac

I would like to launch specific datafile in some way like this:
C:\msdchem\MSexe\msda.exe 1 , "C:\Data\10624-002.D"

Could you help me with this issue?

Tomas
C:\msdchem\1\files.val , is a text file that will load the last opened data file, when Chemstation is activated.

But I'm guessing you want to do is batch processing, so use the TOOLS >> DO LIST
function in the menu bar, to select the files you want to batch process.

p.s. setup a PDF printer and set it to pause, as most macros will want to print something out.

Alex
C:\msdchem\1\files.val , is a text file that will load the last opened data file, when Chemstation is activated.

But I'm guessing you want to do is batch processing, so use the TOOLS >> DO LIST
function in the menu bar, to select the files you want to batch process.

p.s. setup a PDF printer and set it to pause, as most macros will want to print something out.

Alex
Thank you Alex for your post.
I found the file C:\msdchem\1\files.val. So I need to change it before launch MSDChem. My effort is to make a link to chromatograms. I have these chromatograms generated in MS Excel. If the user click on the chromatogram, the specific data file will be opened in MSD Chemstation. I have idea to load data file with some command or macro.

Tomas
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
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
If you're using QEdit, you may want to verify the correct method name is loaded too.

Also I suggest to not edit the "C:\msdchem\MSexe\envinit.mac", as that invalidates the
software validation.

If you create a file named "C:\msdchem\MSmacros\addon.mac", this macro will automatically be run
when you start up Data Analysis (DA). and within that place the command :
MACRO _exepath$+"EditCompound.mac",go

As you appear to be versed in VBA, then DDE should be easy for you, and will make it fast for any students
and keep their interest.
The DDENAME changes each time you start up the DA, so e.g. export the name to an .ini file using the addon.mac,
the name is in the variable _DDENAME$. So in the DA command line , print _DDENAME$ , will display the current DDENAME of that startup.

Alex
If you're using QEdit, you may want to verify the correct method name is loaded too.

Also I suggest to not edit the "C:\msdchem\MSexe\envinit.mac", as that invalidates the
software validation.

If you create a file named "C:\msdchem\MSmacros\addon.mac", this macro will automatically be run
when you start up Data Analysis (DA). and within that place the command :
MACRO _exepath$+"EditCompound.mac",go

As you appear to be versed in VBA, then DDE should be easy for you, and will make it fast for any students
and keep their interest.
The DDENAME changes each time you start up the DA, so e.g. export the name to an .ini file using the addon.mac,
the name is in the variable _DDENAME$. So in the DA command line , print _DDENAME$ , will display the current DDENAME of that startup.

Alex
You are the real Chemstation guru!
I know that modification of "envinit.mac" macro is not the best way. I will use your suggestion "addon.mac". Cool.

I will be thinking about the DDE variables.

Thank you again.
Tomas
7 posts Page 1 of 1

Who is online

In total there are 419 users online :: 1 registered, 0 hidden and 418 guests (based on users active over the past 5 minutes)
Most users ever online was 4374 on Fri Oct 03, 2025 12:41 am

Users browsing this forum: Google Adsense [Bot] and 418 guests

Latest Blog Posts from Separation Science

Separation Science offers free learning from the experts covering methods, applications, webinars, eSeminars, videos, tutorials for users of liquid chromatography, gas chromatography, mass spectrometry, sample preparation and related analytical techniques.

Subscribe to our eNewsletter with daily, weekly or monthly updates: Food & Beverage, Environmental, (Bio)Pharmaceutical, Bioclinical, Liquid Chromatography, Gas Chromatography and Mass Spectrometry.

Liquid Chromatography

Gas Chromatography

Mass Spectrometry