Answer the question
In order to leave comments, you need to log in
Visual Studio 2015, vb.net how to deal with this problem?
I want to make an Excel document and edit it, but this error appears, what should I do?
Dim fileTest As String = "C:\Users\Documents\Visual Studio 2015\Projects\test.xlsx"
If File.Exists(fileTest) Then
File.Delete(fileTest)
End If
Dim oExcel As Object
oExcel = CreateObject("Excel.Application")
Dim oBook As Excel.Workbook
Dim oSheet As Excel.Worksheet
oBook = oExcel.Workbooks.Add
oSheet = oExcel.Worksheets(1)
oSheet.Name = "бла бла бла"
oSheet.Rang("A1").Value = "Что-то"
oBook.SaveAs(fileTest)
oBook.Close()
oBook = Nothing
oExcel.Quit()
oExcel = Nothing
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question