Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> FORMS DDE running a macro

FORMS DDE running a macro

From: DiggidyMack69 <DiggidyMack69_at_hotmail.com>
Date: 29 May 2003 07:36:15 -0700
Message-ID: <c86ce4f.0305290636.7f07372@posting.google.com>


FYI all,
I have seen alot of folks asking about how to run a Macro in excel via DDE.
/*** start Excel and open c:\wkbkwithmacro.xls in normal mode ***/
AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\Office\Excel.exe ' ||
c:\wkbkwithmacro.xls,DDE.APP_MODE_NORMAL);

/*** start a conversation with Excel at sheet1 I would normally poke
something in at this point but I am keeping this brief ***/

ConvID := DDE.Initiate('EXCEL', 'sheet1');

/*** run the macro Macro1 ***/

dde.execute(convid,'[run("Macro1")]',1000);

Ok, My only problem with this is that if I have the Macro protection turned on to high or medium it will stop the program and Excel asks me if I want to Enable or Disable running Macro's. It runs fine if you turn Macro protection off but I don't want to do that. Anyone know, in DDE, a way to programmatically Enable Macro's?? Or Is there are VB command I could run to do this?

Thanks,
DM Received on Thu May 29 2003 - 09:36:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US