老师你好,用下述代码,无法实现将某列设置成日期格式(要求带时分秒)。怎么修改这个代码?谢谢
Dim file As String = "D:\Users\admin\Downloads\20241006_105800.xlsx"
Dim Book As New XLS.Book(file)
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
Dim StyleDate As XLS.Style = Book.NewStyle() '定义新样式
StyleDate.Format = "yyyy-mm-dd hh:mm:ss" ' "yyyy-m-d h:mm:ss"
Sheet.Cols(10).Style = StyleDate
Book.Save(file)