I am having an issue with Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Declarations from Earlier in the sub
Issue area...
Rather than it selecting the C:\Users\UserName\Desktop as default path, It pulls up the path selection window, and no matter what location I chose, it saves to C:\Users\UserName\Documents in the correct File name (ie. EmployeeID_9999.xls).
Did I miss a reference or import?
Declarations from Earlier in the sub
VB.NET:
Dim oExcel As Excel.Application
Dim oBook As Excel.Workbook
Dim oSheet As Excel.Worksheet
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Add(Type.Missing)
oSheet = oBook.Worksheets(1)
Issue area...
VB.NET:
Dim fileName As String = "EmployeeID_"
Dim fileID As String = TextBox2.Text
Dim Path As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim exten As String = ".xls"
Dim finalPath As String
finalPath = String.Concat(fileName, fileID, exten)
oSheet.Columns.AutoFit()
oBook.SaveAs(finalPath, XlFileFormat.xlWorkbookNormal, Type.Missing, Type.Missing, Type.Missing, Type.Missing, XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing)
Rather than it selecting the C:\Users\UserName\Desktop as default path, It pulls up the path selection window, and no matter what location I chose, it saves to C:\Users\UserName\Documents in the correct File name (ie. EmployeeID_9999.xls).
Did I miss a reference or import?