How can I set text orientation in Excel using matlab actxserver?

31 ビュー (過去 30 日間)
Wenquan
Wenquan 2022 年 12 月 29 日
編集済み: Walter Roberson 2022 年 12 月 30 日
Hello, I'm using matlab actxserver to write a excel table. I want to change the orientation of text. I have checked some VBA codes and tried a few codes. Actually I don't know how to transform a VBA code in Matlab code. I have tried:
eSheet.Range.Orientation=90;
eSheet.Range.XlOrientation=-4171;
They don't work.
Can anyone help with the right syntax. Is there a good guide anywhere for the matlab activex syntax versions of VBA commands ?

採用された回答

Cameron
Cameron 2022 年 12 月 30 日
Excel = actxserver('Excel.Application');
set(Excel, 'Visible', 1);
Workbooks = Excel.Workbooks;
Workbook = invoke(Workbooks, 'Add');
Excel.ActiveWorkbook.ActiveSheet.Range("C3").Value = "Example Text";
Excel.ActiveWorkbook.ActiveSheet.Range("C3").Orientation = 90;
  1 件のコメント
Wenquan
Wenquan 2022 年 12 月 30 日
Thank you very, very much! It works now.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeUse COM Objects in MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by