Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-07-2008, 03:16 PM   #1
Registered User
Join Date: Apr 2008
Posts: 1
Default Excel and Flex interaction


I would like to embed a Flex application on an Excel worksheet. The Flex application must be able to communicate with Excel VBA code (to transmit or receive data for example).
The only way yet found to interact is to use the ExternalInterface.call() method in Flex application. Arguments can be passed, althought the call is transmitted under XML string form into Excel VBA code (string must be parsed manually in VBA code). A value is returned to Flex application using the SetReturnValue method of the ShockwaveFlash object. The returned value is of string type, even if we specify an other type in response message. 1) As the return value from the ExternalInterface.call() method is of 'object' type, is it possible to get the return value according to its specified type in Flex application?

The ExternalInterface is a bi-directional API, so it is theoretically possible to send command to Flex application from Excel VBA. I've tried many argument syntax (based on XML, like "Call ShockwaveFlash1.CallFunction("<invoke name=""aFlexMethod"" returntype=""xml""/>")") without any success.
2) How can I call Flex methods from Excel VBA code?

An other problem with the ExternalInterface use, is that, when the Flex application is set to 'embedded' to Excel, a security sandbox violation error is thrown:
SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller file:///C|/Program%20Files/Microsoft%20Office/OFFICE11/EXCEL.EXE cannot access <unknown>.
I tried to change some properties (allowDomain, allowInsecureDomain, allowScriptAccess, allowNetworking) without any results.
3) How can I get rid of this error?

The ShockwaveFlash object has GetVariable() / SetVariable() and TGetProperty() / TSetProperty() methods. All I know is that the GetVariable with "/" argument returns "_level0" and all the other returns 'method call failed' or a 'Type mismatch' error.
4) How can I use these methods to get/set Flex existing public variables or to customize displayed components?

5) Are there some other methods / properties that allow Flex / Excel communication (passing an Excel worksheet data into an array argument to Flex application for example)?

Thanks in advance.

PS: see the Excel 2003 and Flex files showing described problems.
Attached Files
File Type: zip FlashCall.zip (271.9 KB, 1853 views)
rico is offline   Reply With Quote
Old 08-01-2008, 03:31 PM   #2
Registered User
Join Date: Aug 2008
Posts: 1
Default Flex and Excel interaction

You may want to check out the Excel Data Server at http://www.d-w-systems.com/products.html . It may serve your purpose.

devg is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting to Excel from DataGrid Rod F Projectors and CDs 13 08-28-2010 04:25 PM
Excel .XLS parser in AS3 ? aftershock ActionScript 3.0 1 02-05-2007 02:12 PM

All times are GMT. The time now is 12:41 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.