I am using visual studio express 2012,
i have created a Vb calculation application (outputs based on variable inputs) & i need to save these input and output data to excel file each time i click save.
More Details
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim xls As Microsoft.Office.Interop.Excel.Application
Dim xlsWorkBook As Microsoft.Office.Interop.Excel.Workbook
Dim xlsWorkSheet As Microsoft.Office.Interop.Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
xls = New Microsoft.Office.Interop.Excel.Application
xlsWorkBook = xls.Workbooks.Open("D:\bookl.xlsx")
xlsWorkSheet = xlsWorkBook.Sheets("sheet1")
xlsWorkSheet.Cells(1, 1) = TextBox1.Text
xlsWorkBook.Close()
xls.Quit()
End Sub
my problem here is that in every time i click the save button it saves the data to a excel sheet file which i have to specify its path previously.
What i wish to do is if there is any way to load from VB it self then choose where to save it (because iam going to use it in a lot of machines, so i don't want to put the excel file in the same path each time i use the application in any other machine)
Loading

Laxmikant55 reputationPosted Jan 8, 2014, 11:47 AM EST
For more info you can see
http://dotnetmentors.com/c-sharp/how-to-export-sql-data-to-excel-using-microsoft-office-interop.aspx
amado first5 reputationPosted Jan 8, 2014, 12:01 PM EST
Anubhav ChaudharyRank #29 · 42K reputationPosted Jan 8, 2014, 8:09 PM EST
I think you should try it from here:
http://www.dotnetcurry.com/showarticle.aspx?ID=144
You can also try my these Articles:
http://www.c-sharpcorner.com/UploadFile/cd7c2e/export-sql-data-to-excel-using-Asp-Net/
http://www.c-sharpcorner.com/UploadFile/cd7c2e/delete-a-file-on-certain-attempts-by-invalid-user/
amado first5 reputationPosted Jan 8, 2014, 11:44 PM EST
Garry Gibson20 reputationPosted Apr 24, 2014, 2:54 AM EDT
Dim xlsWorkBook As ExcelFile = ExcelFile.Load("bookl.xlsx")
Dim xlsWorkSheet As ExcelWorksheet = xlsWorkBook.Worksheets("sheet1")
xlsWorkSheet.Cells(0, 0) = TextBox1.Text
xlsWorkBook.Save("bookl.xlsx")
You can specify file path for both Load and Save methods by providing an absolute path or a path relative to the applications execution file path.
barcode addict20 reputationPosted May 3, 2014, 11:57 PM EDT
http://stackoverflow.com/questions/21020359/export-data-from-vb-to-excel-sheet