Error: Object returned error code: 0x800A03EC when using actxserver, get command.

2 views (last 30 days)
I am trying to update the excel file using actxserver. I am trying to write more than 256 columns in the excel file. the format of the excel file is xlsx. Following is the code snitted which I am using to write: lastCol = 10; for i = 1:(720/4) lastCol = lastCol + 1; alphabet = num2alp(lastCol); write_alphabet_from = alphabet; columntill = lastCol + 3; alphabet = num2alp(columntill); write_alphabet_till = alphabet; lastCol = columntill; range=[write_alphabet_from num2str(1) ':' write_alphabet_till num2str(1)]; exlSheet1.Activate; exlSheet1 = exlSheet1.get('Range',range); exlSheet1.MergeCells = 1; val = strcat('Columan Title ',num2str(i)); exlSheet1.Value = val; end note: 1) num2alp is a function which returns me a the alphabetical name of the column in excel which I am later using to write the data. 2) 720/4 is only to ensure that I have (720/4) merged cells which I can use as header. But later write operation will be done in all 720 columns in the excel. 3) I am able to update data for 1st 10 columns, hence variable lastCol is set to 10 at the beginning of the loop.
I am getting error with "exlSheet1 = exlSheet1.get('Range',range)" when "i" reaches 89.
Any help to resolve it is very much appreciated !!
Cheers !!

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!