title: Change colour of specifics excel cells using index numbers with Matlab
body: <p>I am new in this community and really need some help.</p>
  
  <p>I was wondering whether someone could help me with a small part of the code that I need to develop.</p>
  
  <p>I have to highlight specifics cells in excel using Matlab. These cells are based on a condition that I have previously applied in my code and that will provide me a vector where the condition is not met and then I require to highlight in excel these cells using actxserver. I have been looking for other answers and I could not get info of how to do this. In VBA you can use Cells command to select specifics cell based on index and not range. It is working if I use range but in my case, the range will be changed depending on the work, so an index is the more appropriate. 
  Example vector of 1X178 and I have found that values at 2 6 9 12 14 19 do not meet the condition, therefore, I would like to highlight in Excel. 
  Thank you very much.</p>
  
  <pre class="lang-m prettyprint-override"><code>vector_column=[2 6 9 12 14 19];
  Excel=actxserver('excel.application') % Active server
  WB=Excel.Workbooks.Open(fullfile('C:\Users\Cruz\Desktop\New folder','test_check2.xlsx'),0,false); % Open workbook
  for j=1:size(vector_column,2)
   WB.Worksheets.Item(1).Cells(17,vector_column(j)).Interior.Color=hex2dec('00FF00');
   % Tried to change colour of excel cells at row 17 and columns number specify in the vector
  end
  
  WB.Save();
  WB.Close();
  Excel.Quit();```
  
  
  
  </code></pre>