some problem while accessing the Microsoft Excel using “actxserver” command

7 views (last 30 days)
In our application through, “actxserver” it constantly updates few excel Excel files. Since this application is time critical I can’t close those Excel files(which are connected to “actxserver”),because for updating those files again we need to open it through invoke(that will take some time depending upon the size of these Excel files)
But while this application is running & we are updating these Excel files through “actxserver” commands, if user want to open any other Excel sheet (which is been created earlier) not through Matlab but by just double clicking on that Excel Sheet, all the existing Excel files(which are updated by Matlab through “actxserver” commands) are also getting visible.
And now its hard to go through User’s Excel sheet(which he opened afterwards just by double clicking), because all these files(files which are updted through “actxserver” commands in Matlab + User’s Excel file) are visible now & they are continously poping on the desktop one by one.
So is there any way so that I can create another connection to Excel, which won’t be used by User when he tries to open some of his existing Excel files.
Right now we are establishing a connection to excel just by simplly executing following command:
Excel = actxserver('Excel.Application');
Excel.Visible = 0;
Workbooks = Excel.Workbooks;
set(Excel, 'DisplayAlerts', 0);
Kindly let me know, if you have any suggestions/queries.

Answers (1)

Image Analyst
Image Analyst on 10 Jun 2014
Perhaps there is a way to set visibility of individual worksheet in addition to the visibility of the whole Excel application. I don't know, I'd have to look through the ActiveX methods, which you can do just as well as I can. If so, set those workbooks invisible then maybe when the use launches Excel they still won't be visible.
  1 Comment
pradeep varma
pradeep varma on 10 Jun 2014
I have also tried with making Worksheet invisible, but as soon as another Excel Sheet is opened by user(by double clicking on it), these excel sheets(which are connected to “actxserver”), are also getting opened but this time the sheet(Here in "Sheet1") in which i am updating the data is not visible,& the other Sheets("Sheet2" & "Sheet3") are visible.
But still its quite anoyying that along with User's Excel sheet(which he opened by double clicking on that Excel Sheet), the other Excel sheets(which are connected to “actxserver” in Matlab), are also continously poping on the desktop one by one.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!