取excel 文件字节数,BuiltinDocumentProperties("number of bytes") 出错了?为什么?
Private Sub Command_Click()
FileName = "C:\DatabaseStructure.xls"
Dim wordoxl As New excel.Application
Dim excelworkbook As New Workbook
wordoxl.Workbooks.Open (FileName)
Set excelworkbook = wordoxl.ActiveWorkbook
MsgBox excelworkbook .BuiltinDocumentProperties("number of bytes")
End Sub 出错:
automation error
Unspecified error
为什么? 读其他是可以的
Private Sub Command_Click()
FileName = "C:\DatabaseStructure.xls"
Dim wordoxl As New excel.Application
Dim excelworkbook As New Workbook
wordoxl.Workbooks.Open (FileName)
Set excelworkbook = wordoxl.ActiveWorkbook
MsgBox excelworkbook .BuiltinDocumentProperties("number of bytes")
End Sub 出错:
automation error
Unspecified error
为什么? 读其他是可以的
Set excelworkbook =wordoxl.Workbooks.Open (FileName)
不行,我试过
automation error
Unspecified error
为什么?
===============
原因就是你上一次大开的Excel对象没有关掉!
你又打开了一遍,当然要错的啊!
记得用quit退出,要不就声明成共有变量,在form_unload的时候将其关闭。