从vb.net

时间:2015-05-12 19:07:49

标签: vb.net excel

我想在从datatable导出到excel时隐藏列。这是我的代码

`Dim xapp As Application
 Dim xWb As Workbook
fileName = System.IO.Path.GetTempFileName & ".xls"
 fileName = fileName.Replace(".tmp", "")
 xapp = New Application()
 xWb = xapp.Workbooks.Open(fileName)
 xWb.Sheets(2).Columns("I:I").EntireColumn.Hidden = True`

即使我提到隐藏列的代码,执行时它仍然出现在excel中。请帮我。 提前致谢

0 个答案:

没有答案