none
Exporting to Excel via VBA RRS feed

  • Question

  • They say if you shoot for the moon and fall short, you still land on a star.  Here it goes.

    At the risk of sounding needy or lazy, I have a beginner understanding of VBA.  All I want to do is the following:

    Import variable data from Project 2010 to fixed fields in Excel 2010.

    There are currently no viable, pre-defined reports (in Project 2010) which need to show the exact data my stakeholders want to see via an Excel file.  The choice for "custom reports" is still very restricting as well as confusing.

    So here's my question (or request):  Is there anyone willing to help me with the coding WITHOUT prompting me to buy a book, tutorial software, subscribe to a site, or charge a fee for building the entire code?  I know if someone can "demonstrate" on example piece to the assignment of variables, I can do the rest.

    Thanks, in advance, to those that refrain from monetary solicitation of goods and services.

    Friday, September 30, 2011 7:13 PM

Answers

  • Wade,

    Wow, you don't want much do you! Okay, here's the free approach to VBA. One good source for learning Project VBA is listed on the MVP website at, http://project.mvps.org/links.htm. At the bottom of the page you will see a link for Project 98 Visual Basic Environment Training Materials. Even though it says Project 98, all of the material presented is equally applicable to current versions of Project. The only real difference is that with each new version of Project, typically more objects, methods, etc. are made available. However just for reference, I still have some VBA macros I wrote under Project 4.1 (i.e. Project 97) that still work fine with Project 2010. I had to translate them from pre-Project 98 VBA to Project 98 VBA, but other than that, they are fine.

    A second source of VBA information is available from MVP Jack Dahlgren's blog. You can find it at, http://Zo-d.com/blog/archives/programming.html.

    Good luck with VBA. It's fun and opens up a whole new world of Project functionality once you learn the basics.

    John

    • Marked as answer by Wade MD Sunday, October 2, 2011 1:57 PM
    Saturday, October 1, 2011 3:41 PM

All replies

  • Take a look at the File Save As and and save as the Excel file type. There you can define "Maps" that allow you to export whatever fields you want to export.

    A few minutes experimenting there might save you some VBA coding.


    Brian Kennemer – DeltaBahn Senior Architect
    Blog | Twitter | LinkedIn
    Friday, September 30, 2011 8:07 PM
    Moderator
  • Adding to Brian's recommendation, don't forget that you can record yourself
    walking through a couple of steps to generate a repeatable macro as well.
    (on the Developer tab - you may have to customize the Ribbon to get it to
    show.)
     
     

    Andrew Lavinsky [MVP] Blog: http://azlav.umtblog.com Twitter: @alavinsky
    Friday, September 30, 2011 11:44 PM
    Moderator
  • Wade,

    Wow, you don't want much do you! Okay, here's the free approach to VBA. One good source for learning Project VBA is listed on the MVP website at, http://project.mvps.org/links.htm. At the bottom of the page you will see a link for Project 98 Visual Basic Environment Training Materials. Even though it says Project 98, all of the material presented is equally applicable to current versions of Project. The only real difference is that with each new version of Project, typically more objects, methods, etc. are made available. However just for reference, I still have some VBA macros I wrote under Project 4.1 (i.e. Project 97) that still work fine with Project 2010. I had to translate them from pre-Project 98 VBA to Project 98 VBA, but other than that, they are fine.

    A second source of VBA information is available from MVP Jack Dahlgren's blog. You can find it at, http://Zo-d.com/blog/archives/programming.html.

    Good luck with VBA. It's fun and opens up a whole new world of Project functionality once you learn the basics.

    John

    • Marked as answer by Wade MD Sunday, October 2, 2011 1:57 PM
    Saturday, October 1, 2011 3:41 PM
  • Thanks for responding, Brian.

     

    I've been trying to use the same object methods in Project 2010 by referencing Excel object types.  However, it wasn't working that well.  Each time I wrote a single line of code to open the file, it "bombed on me".  So I am going to take everyone's advice, here, and work with it.

    Sunday, October 2, 2011 1:54 PM
  • Thanks for all these very useful references. 

    As I mentioned in my original post, I really don't mind the coding.  I just needed some direction on to where I would obtain "guidance" without having to shell out money I don't have.  Of course, once I finish this small project, I will have some funds to invest in a VBA home "course".

    I've downloaded the suggested VBA training guide based on your direction.

    Once again, I sincerely appreciate your help.

     

    Wade

    Sunday, October 2, 2011 2:01 PM
  • Wade,

    You're welcome and thanks for the feedback.

    John

    Sunday, October 2, 2011 3:31 PM
  • Well Im suggesting that if all you need to do is get task data into Excel then be able to do it without any coding if you examine the Export Maps feature when you do a file SaveAs and then pick Excel 2010 as the file format.
    Brian Kennemer – DeltaBahn Senior Architect
    Blog | Twitter | LinkedIn
    Tuesday, October 4, 2011 2:06 AM
    Moderator