I dont have access to Project so its not easy to play around and test anything :-(
Do you have an example of the table/data you want to export to MPP file?
You could start by trying this using and MDB, just to see if its possible because if it was then you could maybe have an MDB file which you used to first insert the data you wanted to export to Project. If you see what I mean?
I’ve now come to the conclusion that the easiest method using an .accdb database (2013, 2016, 2017 …) is to export the data from Access into a csv file and then manually import it into Project. The process is very similar to importing data from an MDB file and doesn’t really take any longer.
You can easily export the data from Access using some VBA code similar to this.
I was hoping to be able to automate Project (start it using vba code) but as yet I haven’t been able to. If I could then I would be able to get Project to import the csv file automatically.
Manuel overførsel giver vist ikke mulighed for at få opdaterede data retur fra Project. Det er vigtigt de opdaterede data kan returners tilbage til Access
It wasn't possible to automate it using MDB, or at least as far as I am aware, so I very much doubt its going to be possible with accdb. I've read quite a lot of information on thee web and Project 2007 seems to give many users the same problems as you have.
But I still intend to try and find a solution, just think the CSV file is the closest we can get to a usable solution.
Yo need to make an export specification by using the export wizard.
Right click the query and then choose Export. Choose Text File Alter Path/Filename Press OK (Do not choose Export Data with ... ) Now you are in the Export Text Wizard
Choose the Advanced Button. Now you can choose Field Delimiter. You could use ; instead of ,
Now you need to Save the Specification by press the Save As button.
The name you choose here is the same as the name you use in "SpecificationNameGoesHere"
If you follow the Export wizard you also get the opportunity to Save the Export Spec. If you do this then it gets saved under External Data (menu) Saved Exports. Now you dont need to use DoCmd.TransferText.... you can just run the Export Spec you just saved :-)
You need to make a macro which imports the CSV file and save the macro giving it an appropriate name. < 1. Hvor skal den oprettes og er navnet ImportCSV ? 2. Hvad skal den indeholde. Er det Sub RunProjectImportMacro() ?
Jeg afslutter her men vender måske tilbage senere (Efter Jul) når anden del af projektet skal laves - nemlig at få ændrede data fra Project ind i Access
Jeg regner med det skal laves i SQL inde i Project VBA. Eller hvad mener du?
You've marked your last comment as solution to your problem ;-)
Not sure how to go about getting data from Project, maybe its also possible to go about it in a similar way. IE Create a macro in Project which exports to csv file and then import it into Access. Macro also gets executed from Access ...
Had to say what problem is when I cant see what you are doing.
When do you get the error?
You can try compiling the code and if anything is wrong with references etc. then you should get an error. You can find Compile in the DEBUG menu when in code view.
And please accept one of my comments as an answer if your happy with the help you have received ;-)
If there isn't a reference to Microsoft Project 12.0 Object Library then how does it work (or not)?
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.