author = CType(workBook. BuiltinDocumentProperties(“Last saved by”). Value, String) : here I’m getting late binding error
Attaching my full code here:
Dim excelApp As New Application
Dim workBook As Workbook = excelApp.Workbooks.Open(FilePath)
author = Clype(workBook. BuiltinDocumentProperties(“Last saved by”). Value, String)
Console. WriteLine("Author: " , author)
workBook.Close(False)
excelApp. Quit
ReleaseComObject(workBook)
ReleaseComObject(excelApp)
End Sub
Private Sub ReleaseComObject(ByVal obj As Object)
Try
If obj IsNot Nothing Then
Marshal.ReleaseComObject(obj)
End If
Catch ex As Exception
Handle the exception, if needed
Finally
obj = Nothing
End Try
Please help if anyone knows about vb.net code
Anil_G
(Anil Gorthi)
February 15, 2024, 6:20pm
2
@Ambika_Singh1
try this
Dim author As String = Ctype(workBook. BuiltinDocumentProperties("Last saved By"). Value, String)
cheers
pikorpa
(Piotr Kołakowski)
February 15, 2024, 6:42pm
3
Hey @Ambika_Singh1
Try this:
Dim excelApp As New Application
Dim workBook As Workbook = excelApp.Workbooks.Open(FilePath)
Dim author As String = CType(workBook.BuiltinDocumentProperties("Last saved by").Value, String)
Console.WriteLine("Author: ", author)
workBook.Close(False)
excelApp.Quit()
ReleaseComObject(workBook)
ReleaseComObject(excelApp)
Hi thanks for the reply, but i have already initialised author variable in arguments and I’m passing that in this code.
And also, i have tried doing this either ways still i’m getting this issue
Hi everyone,
I got the solution. Here the is link of the youtube video.
Thanks,
Ambika
system
(system)
Closed
February 29, 2024, 6:38pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.