1

Why does the code return an empty result?

Private FileName As String

Private Sub btSave_Click(sender As Object, e As EventArgs) Handles btSave.Click
    Dim xlObj As Object
    xlObj = GetObject(, "Excel.Application")
    Dim myExcel As Microsoft.Office.Interop.Excel.Application = xlObj
    Dim BookPrint As Microsoft.Office.Interop.Excel.Workbook = myExcel.Workbooks(1)

    FileName = BookPrint.FullName
    BookPrint.BuiltinDocumentProperties("Subject").Value = "222"
    BookPrint.BuiltinDocumentProperties.Item("Comments").Value = "111"
    BookPrint.Save()
End Sub

Private Sub btRead_Click(sender As Object, e As EventArgs) Handles btRead.Click
    Dim Info As FileVersionInfo
    Info = FileVersionInfo.GetVersionInfo(FileName)

    MsgBox("Boock: " & FileName & vbCrLf & Info.ToString)
End Sub
theduck
  • 2,589
  • 13
  • 17
  • 23
StatSevera
  • 11
  • 1

0 Answers0