我正在尝试将 excel VBA 代码转换为 c#。此代码必须在 excel 之外执行,我将转换我的 excel 宏来执行此操作。这是要转换的代码
ActiveWindow.Zoom = 85
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.Select
这是我到目前为止得到的:
var excelApp = new Microsoft.Office.Interop.Excel.Application();
excelApp.Visible = true;
excelApp.ActiveWindow.Zoom = 85;
excelApp.Range["A1"].Select();
我无法弄清楚下面的其余部分Range("A1").Select
。对此有任何帮助