Problem with ActiveX and Autofilter
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, I'm currently trying to generate an Excel-file with an autofilter. Therefore I'm using the following code.
%Open ActiveX
e = actxserver('Excel.Application');
ewb = e.Workbooks.Open(fullFileNameSave);
sheetNumber = 1;
...
...
%Selecting worksheet and apply freezePanes
nS=ewb.WorkSheets.Item(sheetNumber);
nS.Activate();
nS.Application.ActiveWindow.SplitRow = 1;
nS.Application.ActiveWindow.FreezePanes = true;
%AutoFilter
nR = nS.Range('A1:D1');
nR.Select;
nR.AutoFilter;
...
...
ewb.Save
ewb.Close;
e.Quit;
delete(e);
The code is running without any errors. But when I'm trying to apply a sorting rule in this Excel file Excel is hanging-up and I have to kill the process.
Thanks for your help.
Kind regards, Alex
0 Kommentare
Antworten (1)
Ankita Nargundkar
am 9 Mär. 2017
1. Since the excel file is generated successfully it may be that the issue is not with MATLAB but with Excel sheet. Check if your version of Excel you have is supported by MATLAB
2. Try the sample example from this link and use Autofilter ans apply sorting rule on the excel file that is generated. See if you get similar issue
3. You may also contact MathWorks technical support if you strongly feel that the issue from the MATLAB's side
0 Kommentare
Siehe auch
Kategorien
Mehr zu ActiveX finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!