Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileSaveAs MS Project to MS Access
I am trying to save a MS Project File to MS Access based on user input,
thus i can't specify an exact path. I need to save the data from Project to Access (using FileSaveAs), then create a query and paste to Excel (using an ADO connection). Here is the piece of code that does not work. Thanks in advance: 'FileSaveAs is a problem, I get a run-time error 1101 - Value is not Valid FileSaveAs Name:="<" & AccessFName & "<\" & ProjectFName, FormatID:="MSProject.MDB8" FileExit (pjDoNotSave) 'Connect to DB Dim ConnDB As ADODB.Connection Dim rstDB As ADODB.Recordset Dim strSQL As String Dim strSQL2 As String Set ConnDB = New ADODB.Connection Set rstDB = New ADODB.Recordset ConnDB.Provider = "Microsoft.Jet.OLEDB.4.0;" 'The ConnectionString is a problem, it only wants to read a path, not the string i pass to it ConnDB.ConnectionString = "Data Source=AccessFName" The rest of the code works fine. just need to work this out so i can accept any user's input. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileSaveAs MS Project to MS Access
"Data Source=" & AccessFName
would be my guess for number 2. I have never seen anthing like this: FileSaveAs Name:="<" & AccessFName & "<\" & ProjectFName, FormatID:="MSProject.MDB8" -- Regards, Tom Ogilvy "Ski" wrote in message oups.com... I am trying to save a MS Project File to MS Access based on user input, thus i can't specify an exact path. I need to save the data from Project to Access (using FileSaveAs), then create a query and paste to Excel (using an ADO connection). Here is the piece of code that does not work. Thanks in advance: 'FileSaveAs is a problem, I get a run-time error 1101 - Value is not Valid FileSaveAs Name:="<" & AccessFName & "<\" & ProjectFName, FormatID:="MSProject.MDB8" FileExit (pjDoNotSave) 'Connect to DB Dim ConnDB As ADODB.Connection Dim rstDB As ADODB.Recordset Dim strSQL As String Dim strSQL2 As String Set ConnDB = New ADODB.Connection Set rstDB = New ADODB.Recordset ConnDB.Provider = "Microsoft.Jet.OLEDB.4.0;" 'The ConnectionString is a problem, it only wants to read a path, not the string i pass to it ConnDB.ConnectionString = "Data Source=AccessFName" The rest of the code works fine. just need to work this out so i can accept any user's input. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
get file name for FileSaveAs | Excel Programming | |||
Excel FileSaveAs dialog freezes when used via automation from Access | Excel Programming | |||
Large project ideas, maybe should use Access? | Excel Programming | |||
Allow access to visual basic project | Excel Programming | |||
Forcing a FileSaveAs | Excel Programming |