Subject: HyperChem & DDE

From: Mike Peleah <[email-masked]>
Date: Thu, 14 Oct 1999 15:45:30 +0200

+======================---------------- --- -- -  -   -     -        .
| Dear chemistry,
:
.

Is there any list devoted to HyperChem and HyperChem scripts and DDE?
I have a problem with linking Excel with HyperChem. Problem is so: I
would like to have a log-file of calculations, but it is impossible to
make log when you use DDE. So a made next script (see below), but it
doesn't work properly: 1) DDERequest(HCC, QVal$(2, i)) returns 'Error
2023'  2) DDEExecute HCC, "[read-script...]" doesn't work on 2nd run
(i=1 Ok, but i=2 it do nothing).

Could anybody help me?

------------------- script begins -----------------------------------

    For j = 1 To NMols
       Open MolPath$ & Left(MolData(2, j), InStr(MolData(2, j), ".")) & "scr" For Output As #1
        Print #1, "stop-logging"
        Print #1, "omsgs-not-to-file"
        Print #1, "start-logging " & MolPath$ & MolData(7, j) & " true"
        Print #1, "write-file " & MolPath$ & MolData(7, j) & ""
        Print #1, "errors-are-omsgs"
        Print #1, "query-response-has-tag false"
        Print #1, "one-line-arrays false"
        Print #1, "append-omsgs-to-file " & MolPath$ & MolData(7, j) & ""
  ''''' Open File & run single point ZINDO '''''''''''''''''''''
        Print #1, "open-file " & MolPath$ & MolData(2, j) & ""
        Print #1, "calculation-method semiempirical"
        Print #1, "semi-empirical-method zindos"
        Print #1, "scf-convergence 0.00100"
        Print #1, "max-iterations 200"
        Print #1, "excited-state false"
        Print #1, "quantum-total-charge " & MolData(3, j) & ""
        Print #1, "multiplicity " & MolData(4, j) & ""
        Print #1, "configuration-interaction SinglyExcited"
        Print #1, "do-single-point"
        Print #1, "export-dipole No"
        Print #1, "export-ir No"
        Print #1, "export-orbitals Yes"
        Print #1, "export-UV Yes"
        Print #1, "export-property-file " & MolPath$ & MolData(9, j) & ""
        Print #1, "stop-logging"
        Print #1, "omsgs-not-to-file"
        Print #1, "start-logging " & MolPath$ & "$temp$.tmp" & " true"
        Print #1, "write-file " & MolPath$ & "$temp$.tmp" & ""
        Print #1, "stop-logging"
        Print #1, "omsgs-not-to-file"
        Print #1, "exit-script"
       Close #1
       
       S$ = "[read-script " & MolPath$ & Left(MolData(2, j), InStr(MolData(2, j), ".")) & "scr]"
       DDEExecute HCC, S$
       
       For i = 1 To nqval
         Var = DDERequest(HCC, QVal$(2, i))
         Sheets(MolData(1, j) & "O").Cells(i, 1).Value = QVal$(1, i)
         Sheets(MolData(1, j) & "O").Cells(i, 2).Value = Var
       Next
       
       Open MolPath$ & MolData(9, j) For Input As #1
    Next

------------------- script ends -------------------------------------

Best regards,
 Mike                          mailto:[email-masked]

                                                                     .
                                                                     :
                                                                     |
.        -     -   -  - -- --- ----------------======================+