S Curves

Member for

19 years

Masoud,



I’m writing a VB code to import MSP data to excel and half way through I realized that it needs to do a calculation inside the VB in order to get the % completed on the range date required per hrs, week or month depending on your selection. It will take sometimes to do that in order to get the right formula running when you change the range. I went back to your query and thinking that you only need the code to run “Analyze Timescaled data in Excel”. If that’s the case all you need is a very simple code to include on your current macro.



Try to insert this code and let me know if this help.



Application.CommandBars("Analysis").Visible = True

SendKeys ("%y")



Regards,

Rodel

Member for

19 years

Masoud,



Simple answer is no because it is add-in program or we call it external program. I’m trying to write a visual basic code for your requirement.



Regards,

Rodel

Member for

21 years 2 months

hi Alexandre

check it to see that MSP records no thing about this action.

is there any was instead?



yours truly

masoud

Member for

22 years 9 months

Masoud,

record a small macro when using the analysis toolbar, MS Project will show you in the vba script which are the objects you are looking for

Alexandre

Member for

21 years 2 months

Hi Rodel

i need to plot S-Curve of a project

currently:I use "Analysis time scaled data in excel" button to export %complete of my tasks,then with some correction of round up bug in exported data in excel,i have %complete of each activity & summery in excel.



now the problem is:

i need to export these data to excel automatically from within the VBA code.by the other word, i need to fire this button from inside the VBA code.



sincerely

masoud

Member for

19 years

Sorry Masoud,



I don’t quite understand your query. Can you explain it a bit detail and gave me an example so I can help you further?

Do you want a pop up form to gave you the % complete or export it to excel spreadsheet?



Rodel

Member for

21 years 2 months

hi

thanks a lot for your code snippet.I am familiar with many of MSP object model methods such as UPDATEPROJECT method or EDITCOPY method,but there is not any standard msp method that work like pressing "Analysis time scaled data in excel" button in msp environment.



by another word,is there any method to find out %complete of a rescheduled and/or splited task?



i want to find it from inside of vba method in daily basis



regardes

masoud

Member for

19 years

Hi masoud,



Im not sure how good are you in writing Visual Basic in MSP. I assumed that you are familiar on this command. You can check this sample and use as a guide.



MapEdit Name:="Map 1", Create:=True, OverwriteExisting:=True, DataCategory:=0, CategoryEnabled:=True, TableName:="Task_Table1", FieldName:="ID", ExternalFieldName:="ID", ExportFilter:="All Tasks", ImportMethod:=0, HeaderRow:=True, AssignmentData:=False, TextDelimiter:=Chr$(9), TextFileOrigin:=0, UseHtmlTemplate:=False, TemplateFile:="C:\Program Files\Microsoft Office\Templates\1033\Microsoft Project Web\Centered Mist Dark.html", IncludeImage:=False

MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Name", ExternalFieldName:="Name"

MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Early Start", ExternalFieldName:="Early_Start"

MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Early Finish", ExternalFieldName:="Early_Finish"

MapEdit Name:="Map 1", DataCategory:=0, FieldName:="Duration", ExternalFieldName:="Duration"

FileSaveAs Name:="C:\sample2.xls", FormatID:="MSProject.XLS5", map:="Map 1"



This samples export ID, Name, ES, EF and duration to sample2.xls. I’m not sure what data you required or need to extract in Task_Table.



HTH

Rodel

Member for

21 years 2 months

dear Alexandre Faulx-Briole

i think,i must described the problem:

i want to exporting the values to excel and do something, faster and automated.

i can write some macros and OLE to msp to do some thing like adding tasks automatically.now, i want to export these data automatically



best wishes

masoud

Member for

22 years 9 months

Masoud,

most probably you will call the different ms project objects from inside you vb program; not the button bar

Alexandre

Member for

21 years 2 months

Hi



is there any way to call"analysis in excel" button from inside a VB program.i need to automate the senario.



regards

masoud

Member for

22 years 9 months

Mark,

by using the Analysis toolbar, you will export tue chronological data into Excel and display the S curve there.

That’s the only way to do.

Alexandre

Member for

19 years 5 months

Mark,



Use the ANALYSIS toolbar. It’s quite simple.



James.