0 Replies Latest reply on Aug 16, 2006 9:17 AM by apaz@yahoo.com

    Calling flex methods from Excel

    apaz@yahoo.com
      Hi,

      Has anyone been able to call Flex methods from Excel using the ExternalInterface?

      I have my SWF file playing in a Excel sheet, it loads fine. I can use the ExternalInterface to make calls to Excel and that is also working, but when I try to call methods added through the addCallback using the CallFunction I always get an error:

      Run-time error '-2147467259 (80004005)'

      These are the steps I'm taking. In flex I added my callback method on the init:
      public function onInit():void {
      ExternalInterface.addCallback("test", test);
      }

      public function test():* {
      Alert.show("on test");
      }

      In Excel, I add my ShockwaveFlash object and on a button click call the CallFunction:
      Private Sub CommandButton1_Click()
      Dim callValue As String
      callValue = "<invoke name=""test"" returntype=""xml""><arguments><null/></arguments></invoke>"

      Dim result As String
      result = ShockwaveFlash1.CallFunction(callValue)
      End Sub

      I've been able to successfuly use the ExternalInterface using Javascript, but I'm struggling with calling it from Excel.

      Thanks.