I am generating excel spreadsheet in my VB.net application using Office 2007 but I would like to saving it as Excel 97-2003. I do not know how to save using these formats. Any Clue? This is my code.
worksheet.SaveAs(FileName:=path)
workbooks.Close().
I have tried this below but I get an error that format is not recognized.
'With workbooks
' If Val(Application.Version) < 12 Then
' 'You use Excel 97-2003
' FileExtStr = ".xls" : FileFormatNum = -4143
' Else
' 'You use Excel 2007
' Select Case Sourcewb.FileFormat
' Case 51 : FileExtStr = ".xlsx" : FileFormatNum = 51
' Case 52
' If .HasVBProject Then
' FileExtStr = ".xlsm" : FileFormatNum = 52
' Else
' FileExtStr = ".xlsx" : FileFormatNum = 51
' End If
' Case 56 : FileExtStr = ".xls" : FileFormatNum = 56
' Case Else : FileExtStr = ".xlsb" : FileFormatNum = 50
' End Select
' End If
'End With

Please help!!
worksheet.SaveAs(FileName:=path)
workbooks.Close().
I have tried this below but I get an error that format is not recognized.
'With workbooks
' If Val(Application.Version) < 12 Then
' 'You use Excel 97-2003
' FileExtStr = ".xls" : FileFormatNum = -4143
' Else
' 'You use Excel 2007
' Select Case Sourcewb.FileFormat
' Case 51 : FileExtStr = ".xlsx" : FileFormatNum = 51
' Case 52
' If .HasVBProject Then
' FileExtStr = ".xlsm" : FileFormatNum = 52
' Else
' FileExtStr = ".xlsx" : FileFormatNum = 51
' End If
' Case 56 : FileExtStr = ".xls" : FileFormatNum = 56
' Case Else : FileExtStr = ".xlsb" : FileFormatNum = 50
' End Select
' End If
'End With
Please help!!