As a background, I am trying to delete the 2nd row of my 2007 Excel work book. I dont have MS Office installed on the server and installing them is not a possibility. Using interop Assemblies is of no use since I cant install office. When I tried using the VB script (below) to manipulate the file, it gives me all sorts of errors:
Dim filename As String
Dim appExcel As Object
Dim newBook As Object
Dim oSheet1 As Object
appExcel = CreateObject("Excel.Application")
filename = "C:\test.xls"
appExcel.DisplayAlerts = False
newBook = appExcel.Workbooks.Open(filename)
oSheet1 = newBook.worksheets("Sheet1")
oSheet1.Range("A2").Entirerow.Delete()
newBook.SaveAs(filename, FileFormat:=56)
appExcel.Workbooks.Close()
appExcel.Quit()
I kinda get it that without excel and assemblies, I cant manipulate the file. Is there any other way to achieve this? I dont know what assemblies I can try using. Thanks for reading.
adodb.dll- it's a .NET library so it should be in your Microsoft.NET directory in program files. - SierraOscar