Where is the new Excel workbook created when Access 2000 inside a VS 2005 project?
I recently found out that I can publish a VS 2005 project with all necessary files, like Access 2000 mdb file.
I am using VBA code inside this mdb file to get some data from linked tables and export those data into an Excel file using a query like this:
Code:
dim sql as string
sql = "SELECT * "
sq = sql & "INTO [ExcelWorksheetName] IN ''[Excel 8.0;Database=" & CurrentProject.Path & "\" & nameOfExcelFile & "] "
sql = sql & "FROM MyTable "
where CurrentProject.Path is where the mdb file resides.
My VS 2005 publishes the mdb file with "Content" and "Copy Always" properties set.
After I open the mdb file with a VB.NET application button and with the code:
Code:
Try
Process.Start(My.Application.Info.DirectoryPath & "\\" & "MyAccess2000.mdb")
Catch ex As Exception
Dim msg As String = New StackTrace(ex).GetFrame(0).GetMethod().Name & "(): " & ex.Message
Console.WriteLine(msg)
End Try
All works well with the VBA code inside the mdb, but I don't know where the exported Excel gets created. Can somebody tell me?
I Wasn't sure if this is more Visual Studio question than an Office one.
Re: Where is the new Excel workbook created when Access 2000 inside a VS 2005 project
i would assume if you specify the full path in nameofexcelfile you would have full control to save the file wherever you wish, apart from protected folders, if no path is specified i would be looking into the default data directory for excel