开发者

Is it possible to automate excel from a java applet running in full trust?

I'm looking at all possible languages to solve a particular business case problem.

Basically need a way to allow user to browse for an excel file locally, then using Microsoft Excel COM automation, read in the cell contents and from this point on perform some actions.

I have no experience with Java, but I know this type of thing is "almost" possible using Silverlight 4.0. Here is a line of code that demonstates how you begin automation in silverlight using c#:

dynamic objExcel = AutomationFactory.CreateObject("Excel.Application");

Problem is Silverlight only opens files from "My Documents", and it seems there is nothing you can do to allow the app full access to the file system to read in any file. So I'm investigating if Jav开发者_运维百科a is capable of this task?

I don't need a big explanation on how to do it, mainly I just need your experience as a Java developer to say - Yes in principle its certainly possible, or not. I need to open this xls file from any location the user specifies.

So 2 things really:

  1. Can you browse and open any file using a trusted java applet? And get access to the files path from the open dialog?
  2. Can you automate MS Word / Excel from a Java applet.

Thanks


..Silverlight only opens files from "My Documents", ..

Java will not be able to break that security restriction.

It is for the benefit of the end user, in that if they truly want to edit the Excel file, they will save or move it to My Documents. If they cannot do that, then perhaps they should not be altering the file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜