|Opening Excel using SWT Ole mechanism [message #548480]
||Thu, 22 July 2010 06:12
Registered: July 2010
I am currently trying to use OLE automation with Excel and I encountered the problem with high usage of CPU of course at first. There is reported bug regarding this issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=128841. I managed with using "Excel.Sheet" during creation of OleControlSite object as it is advised as workaround. In this approach the workbook "Worksheet in main" is created in the beginning. In our application we need to run macros programatically and if the user use macros which can have following code e.g. "Workbooks(1).Sheets(1).Cells(2,1)=2" it always will run macro on that default workbook "Worksheet in main", what is a bit annoying for the end user as one thinks that there is only one opened workbook.
Does anyone have any idea how to remove the default workbook which was created when we use "Excel.Sheet" attribute and operate only on the workbook we open? Closing the workbook does not help.
This never happens when "Excel.Application" is used, but high CPU usage is also not an advantage.
Thanks for any ideas/answers.
Powered by FUDForum
. Page generated in 0.03543 seconds