Im trying to make header and footer in excel via matlab using excel VBA. So far i did some manipulations with cells but header and footer is a problem. Here is a code in matlab that opens actxserver and i tried this:
Excel = actxserver('Excel.Application');
Workbooks = Excel.Workbooks;
Excel.Visible = 0;
location=strcat(pwd,'\','testdoc.xlsx');
Workbook = Excel.Workbooks.Open(location);
%%
Excel.PageSetup.LeftHeader='TEST';
%%
Workbook.Save;
Excel.Quit;
I am trying to do next. I am trying to make header on the left,center and right side and make a footer with page number on center and two strings on right and left. Lets use this string 'TEST' for all operations in header and footer. I want to do this in matlab of course.
This is the reference https://msdn.microsoft.com/en-us/library/bb225426(v=office.12).aspx
And this is an example how it works in VBA but i dont know how to do that in matlab using actxserver.
Sub Date_Time()
ActiveSheet.PageSetup.CenterHeader = "&D &B&ITime:&I&B&T"
End Sub
Or:
Worksheets("SomeSheet").PageSetup.LeftHeader = "Some Text"
I am a bit confused. Tnx in advance.