' 判断这个excel文件是否已经打开了; 如果打开了,不能下载
Try
Dim fs AsFileStream = NewFileStream(excelFileName, FileMode.OpenOrCreate, FileAccess.Read)
fs.Close()
Catch ex AsException
MessageBox.Show(excelFileName & "文件当前已经打开,请先关闭")
Return ' 退出
End Try
' 判断这个excel文件是否已经打开了; 如果打开了,不能下载
Try
Dim fs AsFileStream = NewFileStream(excelFileName, FileMode.OpenOrCreate, FileAccess.Read)
fs.Close()
Catch ex AsException
MessageBox.Show(excelFileName & "文件当前已经打开,请先关闭")
Return ' 退出
End Try
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。