What am I missing with opening excel
If I hard code the directory of where my xls file is it works. I want to be able to have it grab the file whereever the program was installed because users will do that to ya, so hardcoding will not work. This line - objWorkBook = objExcel.Workbooks.Open("c:\program files\rsdb\files\ammunitionreq.xls") is the one I want to make dynamic. Something like ..files/ammunitionreq.xls. Here is the bit of code that opens the file
VB Code:
Public Sub Ammunition_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Ammunition.Click
Dim objExcel As Excel.Application
Dim objWorkBook As Excel.Workbook
objExcel = New Excel.Application
objWorkBook = objExcel.Workbooks.Open("c:\program files\rsdb\files\ammunitionreq.xls")
objExcel.Visible = True
objWorkBook = Nothing
objExcel = Nothing
End Sub