Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting MS Project to Access using VBA

Status
Not open for further replies.

lmontes

Programmer
Jan 28, 2002
25
US
I'm trying to write a macro to save the MS Project to an access database. The users have the option to enter the file name and location. I have designed a map called Export Resources.

This is what I have now:

SaveFileName = InputBox$("Enter Path and file to save project to: ")
FileSaveAs Name:=SaveFileName, FormatID:="MSProject.mdb8", map:="Export Resources"

When I run this, I get a runtime error: The argument value is not valid.

When I try the exact same thing to save to Excel, it works.

Any ideas?

 
What happens when you change FormatID:="MSProject.mdb8" to FormatID:="MSProject.mdb"

 
I finally figured it out.

I had to include the <> around the file name..
Thanks for trying to help!
 
Please share the entire correctly coded statement. Thanks.
 
Here you go:

SaveFileName = "<" & InputBox$("Enter Path and file to save project to: ") & ">"

FileSaveAs Name:=SaveFileName, FormatID:="MSProject.mdb8", map:="Export Resources
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top