Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ski Ski is offline
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
get file name for FileSaveAs rroach[_9_] Excel Programming 2 July 14th 05 04:42 PM
Excel FileSaveAs dialog freezes when used via automation from Access No Name Excel Programming 0 May 15th 05 08:49 AM
Large project ideas, maybe should use Access? jruppert[_2_] Excel Programming 0 November 7th 04 03:40 PM
Allow access to visual basic project netzig Excel Programming 2 February 4th 04 06:06 PM
Forcing a FileSaveAs John Petty Excel Programming 6 September 14th 03 01:44 AM


All times are GMT +1. The time now is 11:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"