W
Wanda
Guest
We have an ABL program that sends the data shown in a screen browse to excel. It executes fine when Office is installed in the server. When using Office 365 in gives message 3153 DDE initiate failed. Below is the code used. Notice that we load a variable with the excel path. Is this the correct path for OFFICE 365? Any ideas why the DDE is failing?
DEFINE VARIABLE EE-EXCELON AS LOGICAL INITIAL FALSE.
DEFINE VARIABLE EE-DIRECTORY AS CHAR FORMAT "X(100)" NO-UNDO.
DEFINE VARIABLE EE-INPUT-FILE AS CHAR NO-UNDO.
DEFINE FRAME EE-MAINFRAME WITH SIDE-LABELS.
DEFINE VARIABLE RESULT AS INTEGER.
ENABLE ALL WITH FRAME EE-MAINFRAME TITLE "Worksheet Monitor".
PROCEDURE WinExec EXTERNAL "kernel32.dll": /-Run Windows application----/
END PROCEDURE.
EE-DIRECTORY = "C:\Program Files\Microsstrong textoft Office\root\Office16".
EE-INPUT-FILE = EE-DIRECTORY + "Excel /e".
RUN WinExec (INPUT EE-INPUT-FILE,INPUT 1, OUTPUT RESULT). /* INPUT: 1=normal 2=minimized */
IF RESULT > 32 THEN DO: ASSIGN EE-EXCELON = TRUE.
END.
ELSE DO:
END.
CREATE "Excel.Application" hExcel.
IF NOT VALID-HANDLE(hExcel) THEN RETURN.
DDE INITIATE EE-SYS FRAME FRAME EE-MAINFRAME:HANDLE APPLICATION "Excel" TOPIC "System".
IF EE-SYS = 0 THEN DO: MESSAGE "Excel not available" VIEW-AS ALERT-BOX. RETURN. END.
DDE EXECUTE EE-SYS COMMAND "[new(1)]".
DDE INITIATE EE-SHEET FRAME FRAME EE-MAINFRAME:HANDLE APPLICATION "Excel" TOPIC "Sheet1". END.
Continue reading...
DEFINE VARIABLE EE-EXCELON AS LOGICAL INITIAL FALSE.
DEFINE VARIABLE EE-DIRECTORY AS CHAR FORMAT "X(100)" NO-UNDO.
DEFINE VARIABLE EE-INPUT-FILE AS CHAR NO-UNDO.
DEFINE FRAME EE-MAINFRAME WITH SIDE-LABELS.
DEFINE VARIABLE RESULT AS INTEGER.
ENABLE ALL WITH FRAME EE-MAINFRAME TITLE "Worksheet Monitor".
PROCEDURE WinExec EXTERNAL "kernel32.dll": /-Run Windows application----/
Code:
DEFINE INPUT PARAMETER EE-PROGRAM AS CHARACTER.
DEFINE INPUT PARAMETER EE-PROG-STYLE AS LONG.
DEFINE RETURN PARAMETER RESULT AS LONG.
END PROCEDURE.
EE-DIRECTORY = "C:\Program Files\Microsstrong textoft Office\root\Office16".
EE-INPUT-FILE = EE-DIRECTORY + "Excel /e".
RUN WinExec (INPUT EE-INPUT-FILE,INPUT 1, OUTPUT RESULT). /* INPUT: 1=normal 2=minimized */
IF RESULT > 32 THEN DO: ASSIGN EE-EXCELON = TRUE.
Code:
IF j > 2 THEN
DO:
WKFILE.CHAR1 = EE-DIRECTORY.
RELEASE wkfile.
END.
END.
ELSE DO:
Code:
IF j > 4 THEN
DO:
MESSAGE "Excel Directory - not found" VIEW-AS ALERT-BOX.
RETURN.
END.
END.
CREATE "Excel.Application" hExcel.
IF NOT VALID-HANDLE(hExcel) THEN RETURN.
Code:
hExcel:Visible = FALSE.
DDE INITIATE EE-SYS FRAME FRAME EE-MAINFRAME:HANDLE APPLICATION "Excel" TOPIC "System".
IF EE-SYS = 0 THEN DO: MESSAGE "Excel not available" VIEW-AS ALERT-BOX. RETURN. END.
DDE EXECUTE EE-SYS COMMAND "[new(1)]".
DDE INITIATE EE-SHEET FRAME FRAME EE-MAINFRAME:HANDLE APPLICATION "Excel" TOPIC "Sheet1". END.
Continue reading...