Project VBA Debugging
I am modifiying some Project 2010 VBA modules that I did not write. My predecessor wrote a bit of code that catches an error, outputs the error message (and just that, no specifics compared to run-time or compile errors Project would catch) and ends the
function. Is there a way to modify the following code to provide more description, such as line number, the problem variables, etc.?
Err_cmbMapNow_Click:
MsgBox Err.Description
Resume Exit_cmbMapNow_Click
I think the problem lies in an If statement that checks the file's type against whether or not it's an Enterprise-type Project. The error I'm getting is "The argument is not valid". I tried enforcing them to be Integers so the If statement is comparing
integers, but that doesn't seem to work (if this statement is the problem). When I debug it, it stops at that statement and won't continue.
Mr. Lee,
The problem with error messages is that generally they cover a wide range of possible causes so to the average, or even advanced user, the messages are essentially useless.
Paul is correct, in order for us to help you we will need to see your code. In particular the "If" statement that is being flagged with the error and any other lines of code that provide arguments to that statement. It could also be something as
simple as an incorrect declaration. For example, a variable that is declared as a single (i.e. number) but is being used as a string (i.e. text).
John
Similar Messages
-
I'm using acrobat pro in my project after debuging the project and after opening a certain number of PDF files I receive the message: the maximum number of files opened has been reached, you have to close some files to continu.even doing that, I steel receive the same message.Some one can tel what to do please? Thanks
Hi Memalyn
Essentially, the bare issue is that you have a 500GB hard drive with only 10GB free. That is not sufficient to run the system properly. The two options you have are to move/remove files to another location, or to install a larger hard drive (eg 2TB). Drive space has nothing to do with SMC firmware, and usually large media files are to blame.
My first recommendation is this: download and run the free OmniDiskSweeper. This will identify the exact size of all your folders - you can drill down into the subfolders and figure out where your largest culprits are. For example, you might find that your Pictures folder contains both an iPhoto Library and copies that you've brought in from a camera but are outside the iPhoto Library structure. Or perhaps you have a lot of purchased video content in iTunes.
If you find files that you KNOW you do not need, you can delete them. Don't delete them just because you have a backup, since if the backup fails, you will lose all your copies.
Don't worry about "cleaners" for now - they don't save much space and can actually cause problems. Deal with the large file situation first and see how you get on.
Let us know what you find out, and if you manage to get your space back.
Matt -
Project-wide Debug flags and conditional execution
I've programmed in literally dozens of languages, and an still relatively new to Objective-C and even some C programming techniques. In Perl, for example, I often create a module-wide or project wide debug flag which may be a single boolean true or false or may be a binary flag word with each bit designated for a particular section or protocol I'm working on.
Then I only need to set the debug variable or flag once to enable a slew of debugging code or messages, and can easily turn them all on or just selected ones depending on the project.
In the code I would use some combination of:
$debug = -1;
print "some text" if $debug;
if ( $debug ) {
print "some text";
$debug_state = 1;
$debug_files = 2;
$debug_images = 4;
$debug_all = 127;
$debug = $debug_state & $debug_images;
print "status: ", $status, " flags: ", flags, "
" if ( $debug & $debug_state );
Yes, this is all runtime based, and I can see where it may slow down a production program if the debugging code were inside code which was executed many many times in a short period, but I often will leave this kind of code in production versions for things that should not happen, so that if somehow it does happen due to data or hardware fault, a nice audit trail exists to follow.
Yes, I know about NSLog and printf. The point here is whether to have to endlessly modify code with comment lines into active and dormant lines of code, or to build it once, and forget it except when it needs to be enabled, but it can be enabled without MODIFYING any code.
How many times does// some code here
other code
become
some code here
/ other code
instead of
some code here
// other codewhen editing?
My question is, is there some facility in Objective-C which already does this, either by library or framework? Also, I'd like to know how those of you who consider yourselves experienced in these kinds of things do the same in Objective-C or regular C, gcc, etc.reststop wrote:
My question is, is there some facility in Objective-C which already does this, either by library or framework?
The typical way to do this is via a macro that is defined only if a compile-time debug flag is defined. You don't have to change any code, but then the debug statements do not exist in release mode.
You can keep the debug messages in your release code if you want to. The principle is the same. Instead of macros, use a global debug variable and a function. If the debug variable isn't set, the function just returns. If you are stickler about such things, you can create a singleton object.
Another option is to use syslog functions and use LOG_DEBUG. -
Existing Projects into debugging
We have an existing war based project in eclipse. How can we attach this weblogic server environment to debug it? In other words, do we need to create project in a spefic format to attach it to server? Ours is a maven based project which we fetch it from SVN. Any help is greatly appreciated.
Edited by: user11729136 on Jul 24, 2009 1:42 PMThe Maven checkout project from SVN is the way I do it.
The only issue with maven & oracle enterprise enterprise pack (OEP) happens to be a 'bug' in OEP that I am waiting for a fix. (Re: M2Eclipse (Maven) and Enterprise Pack for Eclipse
The issues is that maven makes use of variable (M2_REPO) to refer to dependent jars and OEP is unable to translate them effectively. -
Project VBA Documentation/Reference
Similar to docs.oracle.com for Java, is there documentation for VBA 2010? I need to look up a few methods for Project 2010 VBA.
Rod Gill wrote the one and only VBA book for project, this is what you need!
http://www.amazon.com/Programming-Microsoft-Project-through-Introduction/dp/1934240214
Hope this helps,
Guillaume Rouyre, MBA, MVP, MCP | -
MS Project VBA - Export tasks by resource
I need to export a list of tasks assigned to each resource. This is basically a Who Does What When just in a different arrangement.
I need to list all of the resource on the left (vertically) then next to each name list the tasks by week. Each tasks shall be listed each week until the task ends.
This is the idea of what the report will look like.
Resources | 2/16/15 | 2/23/15 | 3/2/15
Employee 1 | Task 1 | Task 2 | Task 3
Employee 2 | Task 4 | Task 4 | Task 4
Employee 3 | Task 5 | Task 5 | Task 6
My thought was to use time phased data, but I cant figure out how to get task name from it.
1.Loop through resource names
2.For each Resource filter the task list.
3.Loop through tasks and while withing the data range export the task name.
Any general guidance is appreciated.Gixxerider,
Time phased data won't really help for what you want. If you were looking for cost, hours, or one of the many other time scale variables, then you could use the TimeScaledData Method, but the task name is not a time scale variable.
One question that pops up right away is how would you handle tasks that end mid-week? Would that week show two entries (i.e. task 2, task 3)? Of course if all your tasks just happen to always start when the week starts, then this isn't an issue.
You mention export, but you don't say to what/where. I could assume Excel, but I don't know.
Also, I don't know what you mean by "filter the task list". What are you filtering?
Here is an outline of how I would approach the report.
1. First determine the earliest and latest weeks required for the report. That will be week 1 and week X respectively
2. Loop through each assignment of each resource (nested loops). Assuming the following declarations are made:
Dim r as Resource
Dim a as Assignment
The task name will be given by: a.TaskName, the start of that task will be given by: a.Start, and the finish of that task will be given by a.Finish
3. Determine where the start of each assignment is in reference to "week 1" from step 1. That will give an offset to start the data for each resource's assignment
4. Determine the total number of weeks between the assignment start and finish. That tells how many weeks to repeat that task name.
Pre-format the report given the date for "week 1" through "week x". Then as the data is written for each resource's assignment, use the offset to put the resource's assignment into the correct starting week
Hope this helps.
John -
Hi,
What I’m trying to do is to add XML ribbon to Project Client 2013 using VBA code. I have a method in my VBA project (mpp file) under “ThisProject”. When this project is open, it passes the xml ribbon to ActiveProject.SetCustomUI (“My XML
ribbon content HERE”). I can break point and see the call is being made but ribbon is not visible on the Project Client 2013.
This ribbon works in only one computer (in Project Client 2013). Right now I have this file stored as a local MPP file, but eventually I have to move this code to Project Server (global-check-out location). There are no error or any issues
that I can think.
Why does this work in one computer but not in other three computers? Is My XML schema and the format correct for Project Client 2013? What kind of permissions does Ribbon requires and how can I check them?
Below is my VBA/XML ribbon code:
Private Sub Project_Open(ByVal pj As Project)
Call AddCustomUI
End Sub
Sub AddCustomUI()
Debug.Assert 1 < 0
Dim customUiXml As String
customUiXml = "<mso:cmd app=""MSProject"" dt=""1"" /><mso:customUI xmlns:x1=""http://schemas.microsoft.com/office/2009/07/customui/macro"" xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui""><mso:ribbon><mso:qat/><mso:tabs><mso:tab id=""PMMTab"" label=""PMM"" insertBeforeQ=""mso:TabAddIns""><mso:group id=""grpPMM1"" label=""PMM Options"" autoScale=""true"">" _
& "<mso:button idQ=""x1:btnSetOptions"" label=""Set Options"" imageMso=""TableBorderPenColorPicker"" onAction=""btn_ShowSetOptionsForm"" visible=""true""/><mso:button idQ=""x1:btnSetBaseline"" label=""Set Baseline"" imageMso=""VisibilityHidden"" onAction=""btn_ShowSetBaselineForm"" visible=""true""/>" _
& "<mso:button idQ=""x1:btnSummaries"" label=""Summaries"" imageMso=""DesignXml"" onAction=""btn_InsertATECSummaryTasks"" visible=""true""/><mso:button idQ=""x1:btnExcelRpt"" label=""Excel Report"" imageMso=""AppointmentColor9"" onAction=""btn_ShowExcelReportForm"" visible=""true""/><mso:button idQ=""x1:btnDtLogic"" label=""Date Logic"" imageMso=""AppointmentColor5"" onAction=""btn_ShowDateLogicForm"" visible=""true""/>" _
& "<mso:button idQ=""x1:btnTskSchedule"" label=""Task Schedule"" imageMso=""Bullets"" onAction=""btn_TaskSchedule"" visible=""true""/><mso:button idQ=""x1:btnClean"" label=""Clean"" imageMso=""InkEraseMode"" onAction=""btn_ShowCleanProjectForm"" visible=""true""/><mso:button idQ=""x1:btnQAS"" label=""QAS"" imageMso=""PositionAbsoluteMarks"" onAction=""btn_LaunchQAS"" visible=""true""/>" _
& "<mso:button idQ=""x1:btnPMMSite"" label=""PMM Site"" imageMso=""MsnLogo"" onAction=""btn_GoToPMESDocs"" visible=""true""/><mso:button idQ=""x1:btnActOffsets"" label=""Actual Offsets"" imageMso=""LinkBarCustom"" onAction=""btn_calculateActualOffsets"" visible=""true""/><mso:button idQ=""x1:btnATCForm"" label=""ATC Form"" imageMso=""ViewSlideSorterView"" onAction=""btn_GoToATCForm"" visible=""true""/>" _
& "</mso:group><mso:group id=""grpPMM2"" label=""OTC Options"" autoScale=""true""><mso:button idQ=""x1:btnSetResDefault"" label=""Set Resource Defaults"" imageMso=""ListMacros"" onAction=""btn_SetResourceDefaults"" visible=""true""/></mso:group><mso:group id=""grpPMM3"" label=""External Links"" autoScale=""true""><mso:button idQ=""x1:btnLinkOptions"" label=""Link Options"" imageMso=""ListMacros"" onAction=""btn_LinkOptions"" visible=""true""/>" _
& "<mso:button idQ=""x1:btnTRPOutline"" label=""TRP Outline"" imageMso=""CondolatoryEvent"" onAction=""btn_TRPOutline"" visible=""true""/><mso:button idQ=""x1:btnSynProject"" label=""Sync Project"" imageMso=""RecordsRefreshMenu"" onAction=""btn_SyncProject"" visible=""true""/><mso:button idQ=""x1:btnDetails"" label=""Details"" imageMso=""SlidesPerPageSlideOutline"" onAction=""btn_Detail"" visible=""true""/>" _
& "<mso:button idQ=""x1:btnATCTools"" label=""ATEC Tools"" imageMso=""HyperlinksVerify"" onAction=""btn_ATECTools"" visible=""true""/><mso:button idQ=""x1:btnImportActuals"" label=""Import Actuals"" imageMso=""_3DPerspectiveDecrease"" onAction=""btn_ImportActuals"" visible=""true""/><mso:button idQ=""x1:btnAECMenu"" label=""AEC Menu"" imageMso=""ViewFullScreenView"" onAction=""btn_AEC_Menu"" visible=""true""/></mso:group>" _
& "<mso:group id=""grpPMM4"" label=""Admin Options"" autoScale=""true""><mso:button idQ=""x1:btnChgLog"" label=""Change Log"" imageMso=""ListMacros"" onAction=""btn_ShowChangeLogForm"" visible=""true""/><mso:button idQ=""x1:btnResMaint"" label=""Resource Maint"" imageMso=""CondolatoryEvent"" onAction=""btn_ShowResMaintForm"" visible=""true""/>" _
& "<mso:button idQ=""x1:btnChkResRate"" label=""Check Resource Rates"" imageMso=""TableDesign"" onAction=""btn_checkResourceRates"" visible=""true""/><mso:button idQ=""x1:btnResReport"" label=""Resource Report"" imageMso=""SlideShowUseRehearsedTimings"" onAction=""btn_ShowSetResourceRatesForm"" visible=""true""/></mso:group></mso:tab></mso:tabs></mso:ribbon></mso:customUI>"
ActiveProject.SetCustomUI (customUiXml)
End Sub
Thanks,Hi,
I don't think it likes xl: in the ids. My utility throws up the following that does work:
<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui""><mso:ribbon><mso:tabs><mso:tab id=""PMM"" label=""PMM"" insertBeforeQ=""mso:TabView""><mso:group
id=""PMMOptions"" label=""PMM Options""><mso:button id=""btnSetOptions"" label=""Set Options"" size=""large"" imageMso=""TableBorderPenColorPicker""
onAction=""btn_ShowSetOptionsForm""></mso:button><mso:button id=""btnSetBaseline"" label=""Set Baseline"" size=""large"" imageMso=""VisibilityHidden""
onAction=""btn_ShowSetBaselineForm""></mso:button><mso:button id=""btnSummaries"" label=""Summaries"" size=""large"" imageMso=""DesignXml"" onAction=""btn_InsertATECSummaryTasks""></mso:button><mso:button
id=""btnExcelRpt"" label=""Excel Report"" size=""large"" imageMso=""AppointmentColor9"" onAction=""btn_ShowExcelReportForm""></mso:button><mso:button
id=""btnDtLogic"" label=""Date Logic"" size=""large"" imageMso=""AppointmentColor5"" onAction=""btn_ShowDateLogicForm""></mso:button><mso:button
id=""btnTskSchedule"" label=""Task Schedule"
" size=""large"" imageMso=""Bullets"" onAction=""btn_TaskSchedule""></mso:button><mso:button id=""btnClean"" label=""Clean"" size=""large""
imageMso=""InkEraseMode"" onAction=""btn_ShowCleanProjectForm""></mso:button><mso:button id=""btnQAS"" label=""QAS"" size=""large"" imageMso=""PositionAbsoluteMarks""
onAction=""btn_LaunchQAS""></mso:button><mso:button id=""btnPMMSite"" label=""PMM Site"" size=""large"" imageMso=""MsnLogo"" onAction=""btn_GoToPMESDocs""></mso:button><mso:button
id=""btnActOffsets"" label=""Actual Offsets"" size=""large"" imageMso=""LinkBarCustom"" onAction=""btn_calculateActualOffsets""></mso:button><mso:button
id=""btnATCForm"" label=""ATC Form"" size=""large"" imageMso=""ViewSlideSorterView"" onAction=""btn_GoToATCForm""></mso:button></mso:group><mso:group
id=""OTCOptions"" label=""OTC Options""><mso:button id=""btnSetResDefault"" label=""Set Resource Defaults"" size=""large"" imageMso=""ListMacros""
onAction=""btn_SetResourceDefaults""></mso:button></mso:group><mso:group id=""External
Links"" label=""External Links""><mso:button id=""btnLinkOptions"" label=""Link Options"" size=""large"" imageMso=""ListMacros"" onAction=""btn_LinkOptions""></mso:button><mso:button
id=""btnTRPOutline"" label=""TRP Outline"" size=""large"" imageMso=""CondolatoryEvent"" onAction=""btn_TRPOutline""></mso:button><mso:button id=""btnSynProject""
label=""Sync Project"" size=""large"" imageMso=""RecordsRefreshMenu"" onAction=""btn_SyncProject""></mso:button><mso:button id=""btnDetails"" label=""Details""
size=""large"" imageMso=""SlidesPerPageSlideOutline"" onAction=""btn_Detail""></mso:button><mso:button id=""btnATCTools"" label=""ATEC Tools"" size=""large""
imageMso=""HyperlinksVerify"" onAction=""btn_ATECTools""></mso:button><mso:button id=""btnImportActuals"" label=""Import Actuals"" size=""large""
imageMso=""_3DPerspectiveDecrease"" onAction=""btn_ImportActuals""></mso:button><mso:button id=""btnAECMenu"" label=""AEC Menu"" size=""large""
imageMso=""ViewFullScreenView"" onAction=""btn_AEC_Menu""></mso:button
></mso:group><mso:group id=""AdminOptions"" label=""Admin Options""><mso:button id=""btnChgLog"" label=""Change Log"" size=""large"" imageMso=""ListMacros""
onAction=""btn_ShowChangeLogForm""></mso:button><mso:button id=""btnResMaint"" label=""Resource Maint"" size=""large"" imageMso=""CondolatoryEvent""
onAction=""btn_ShowResMaintForm""></mso:button><mso:button id=""btnChkResRate"" label=""Check Resource Rates"" size=""large"" imageMso=""TableDesign""
onAction=""btn_checkResourceRates""></mso:button><mso:button id=""btnResReport"" label=""Resource Report"" size=""large"" imageMso=""SlideShowUseRehearsedTimings""
onAction=""btn_ShowSetResourceRatesForm""></mso:button></mso:group></mso:tab></mso:tabs></mso:ribbon></mso:customUI>
You'll need to
Rod Gill
Author of the one and only Project VBA Book
www.project-systems.co.nz -
MS Project and print automatically a planning per ressource with VBA code for instance
Hello, i'm in MS project 2010 and i would like to print automatically a planning per ressource (PDF) with VBA code or other quick way.
Somebody can help me with a simple macro VBA and how to install/use it?
regards,
M.Probably oyu need the loop:
Dim Res as Resource
for each Res in ActiveProject.Resources
'Apply resource filter then print
Next Res
Rod Gill
Author of the one and only Project VBA Book
www.project-systems.co.nz -
VBA - Setting Custom Fields For Sub-Projects Using a Master File
Hello,
I was wondering if anyone had any experience or could provide some help with a Macro to set the Custom Fields in Sub-Project Files directly from the Macro. I had this macro working in the past with Project 2007, but it has been a couple years and I am struggling
to resolve an error. I am currently running Project 2010 with SP2. I intend to use this Macro in our Server 2010 environment, however at this time, I'm testing locally on my desktop.
Scenario.
I have a Master File with 2 sub-project (Project A, and Project B) inserted. While working in the Master File, I create a custom field title "TEAM Lookup". While in the Master File and without having to individually go and open, edit, save, and
close each sub-project, push the custom field down to the project files.
ERROR: Currently, the Macro will run and I can step through the lines of code until line 12 where I'm asking Project to use the organizer to shift the newly created custom field from the Master File to a sub-project. The line appears to
populate correctly, but instead of continuing through the loop, an error is caught (ID - 1101 - "The File (Master File) was not found")
Any ideas or suggestions would be greatly appreciated. Thanks
Sample Code
1. Sub CopyCustomFieldToSubprojects()
2. Dim MASTER, custfield, contin, AllDone
3. Dim SubProj As Subproject
4. Alerts False
5. MASTER = ActiveProject.Name
6. Application.EnableCancelKey = pjInterrupt
7. custfield = CustomFieldGetName(ActiveCell.FieldID) & ActiveCell.FieldName
8. On Error GoTo errhand
9. contin = MsgBox("This macro will copy the field " & "(" & custfield & ")" & " (the currently selected field) to all subprojects in this consolidated schedule." & vbCrLf & vbCrLf & "Be
patient, it may take more than 70 seconds to run. You will be notified when it's done. Continue?", vbOKCancel)
10. If contin = vbCancel Then GoTo done
11. For Each SubProj In ActiveProject.Subprojects
12. OrganizerMoveItem Type:=pjFields, FileName:=MASTER, ToFileName:=SubProj.SourceProject.Name, Name:=custfield
13. Next SubProj
14. AllDone = MsgBox("The " & custfield & " field has been copied to all subprojects.", vbOKOnly)
15. GoTo done
16. errhand:
17. ret = err.Description
18. ret1 = err.Number
19. done:
20. End SubSGBlaine,
Project VBA can get rather fussy about some things so you just have to find out what it wants and then adjust your code accordingly. The following will work:
Note the tweaks to the custfield variable and to the MASTER and source project names. Also when working with strings in VBA it is a good idea to eliminate at least one little gotcha, the need for exact capitalization. Therefore I always add the Option Compare
Text statement. In your macro it won't make any difference since you do not directly create a string value, but it's good practice to have the option.
Option Compare Text
Sub CopyCustomFieldToSubprojects()
Dim MASTER, custfield, contin, AllDone
Dim SubProj As Subproject
Alerts False
MASTER = ActiveProject.FullName 'FullName includes the path, now it can find it
Application.EnableCancelKey = pjInterrupt
custfield = CustomFieldGetName(ActiveCell.FieldID) & " (" & ActiveCell.FieldName & ")"
'strings are very fussy, it has to be exact
On Error GoTo errhand
contin = MsgBox("This macro will copy the field " & "(" & custfield & ")" & " (the currently selected field) to all subprojects in this consolidated schedule." & vbCrLf & vbCrLf & "Be
patient, it may take more than 70 seconds to run. You will be notified when it's done. Continue?", vbOKCancel)
If contin = vbCancel Then GoTo done
For Each SubProj In ActiveProject.Subprojects
OrganizerMoveItem Type:=pjFields, FileName:=MASTER, ToFileName:=SubProj.SourceProject.FullName, Name:=custfield
Next SubProj
AllDone = MsgBox("The " & custfield & " field has been copied to all subprojects.", vbOKOnly)
GoTo done
errhand:
ret = Err.Description
ret1 = Err.Number
done:
End Sub
John -
Not able to save changes in VB Project properties under debugging.
I am unable to save Run64BitRuntime property=FALSE for my SSIS VB Project under debugging. I change it, rebuild, save and reopen. Then I check the change I made and it shows reverted to TRUE. What is causing this
ITProTekHi ITProTek,
As far as I know, it is by design.
The Run64BitRuntime project property applies only at design time, for the SSIS packages that really don't make use of the 64-bit processor, the SSIS project property
Run64BitRuntime can be set to False.
Reference:
https://social.msdn.microsoft.com/Forums/en-US/e91d6b6e-207e-4370-84dd-00016de602ab/setting-run64bitruntime-debugging-property-to-false-is-not-deploying?forum=sqlintegrationservices
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/63323b27-0c08-4d8d-bff3-b67a3d5296dc/ssis-2012-run64bitruntime-defaults-to-true?forum=sqlintegrationservices
Best Regards,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Can't open Excel File manually after MS Project has opened it via VBA
I was testing a section of code I got from a forum that opens a Excel Workbook via MS Project VBA so that I could use it to update a Excel Workbook that I have. The macro opens the Workbook as intended but the main problem I'm encountering is that
after I've run the macro, saved and closed the Workbook again, I'm unable to open it manually either from Recents or directly from folder location. I'm using Project 2010 (non Server) and Excel 2010 - Windows 7.
I'm also having trouble getting it to select "Sheet2" of the Workbook when it opens so I've Commented it out, but it would be a bonus if someone could shed some light on that one as well.
Edit: I worked out how to select the Sheet...I've updated the code Below.
Sub OpenTest()
Dim xlApp As Excel.Application
Dim xlWkb As Excel.Workbook
Set xlApp = CreateObject("Excel.Application")
Set xlWkb = xlApp.Workbooks.Open_ ("C:\Users\myName\Desktop\Export Test1.xlsx")
xlApp.Visible = True
xlApp.Sheets("Sheet2").Select
Set xlWkb = Nothing
End Sub
Thanks!
MattMatt,
Actually your macro code works fine and I can re-open the file without problem.
I don't recall asking in your other post but do you have SP2 installed for Project 2010? And, do you have SP2 installed for Office 2010, which will cover Excel? They are separate updates. It would also be a good idea to install the June 2013 cumulative update
for Project 2010 as it was released after SP2 and it does fix some VBA issues as I recall.
As I indicated, your code works fine on my PC which is also Project 2010, Office 2010 and Windows 7. Try this. After you run the macro and then save and close the workbook, does Excel also get closed automatically? If it does, (and it should), after you
close the workbook, take a look at the applications manager to see which Windows applications are currently running. Does Excel still show up?
John -
Reading MS Project column names and data on the fly from a selected View
Hi guys,
I have several views on my project file (MSPROJECT 2010) and I want to build a macro so that;
1. User can select any view ( Views can have diffrent columns and the user may add new columns as well)
2. User runs the Macro and all the coulmns along with the tasks displayed in the view will be written to a excel file. ( I don't want to build several macro's for each view, I'm thinking of a common method which would work for any selected view)
The problem I'm facing is that how will i read the column names and data for a particular view on the fly without hard coding them inside the vba code ?
The solution needs to work on a master schedule as well.
Appreciate your feedback.Just to get you started the following code writes the field name and data for the active task to the Immediate window.
Sub CopyData()
Dim fld As TableField
For Each fld In ActiveProject.TaskTables(ActiveProject.CurrentTable).TableFields
If fld.Field >= 0 Then
Debug.Print Application.FieldConstantToFieldName(fld.Field), ActiveCell.Task.GetField(fld.Field)
End If
Next fld
End Sub
Rod Gill
Author of the one and only Project VBA Book
www.project-systems.co.nz -
Project 2010 SP1 Installation Crashes
I'm trying to create a package that will handle both brand new installations for Project 2010 as well as upgrade installations for those running Project 2007, the latter of which represents a large population in our environment.
I basically followed the same process I used when creating packages for Office 2007, Office 2010, Project 2007 and Visio 2007, all of which work today:
run setup.exe /admin
create a new .msp
make my adjustments (very few)
save into Updates directory
customized PrjPro.WW\config.xml (after first creating a backup!)
run setup.exe
I'm testing the package on a machine that previously had Project 2007, but after running for a short time, setup crashes. I thought maybe the problem was with the config.xml so I undid the changes one at a time, then moved up to restoring the orignal
config.xml file but it continues to crash.
There's a setup log in %temp% that contains what may be the core issue
PERF: TickCount=2427515 Name=OBootStrapper::Run Description=Begin function
Operating System version: 6.1.7601 Service Pack 1. Platform ID: 2
Running 32-bit setup on a 32-bit operating system.
Command line: "\\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\setup.exe"
No command line arguments given
Verify file signature in "\\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\setup.exe"
\\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\setup.exe is trusted.
Verify file signature in "\\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\PrjPro.WW\OSETUP.DLL"
\\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\PrjPro.WW\OSETUP.DLL is trusted.
Using setup controller dll at [\\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\PrjPro.WW\OSETUP.DLL].
PERF: TickCount=2428342 Name=OBootStrapper::Run Description=Calling RunSetup
PERF: TickCount=2428342 Name=RunSetup Description=Begin function
Catalyst execution began: 03/07/2014 13:30:43.
Setupexe Resiliency Mode is set to [PerformIfApplicable]; thus Resiliency is [disabled] for the [InstallExecutionMode]
Searching for updated versions of resource files under the 'updates' folder [\\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\updates].
Found [0] resource files under the update folder.
Searching for default versions of resource files under the folder [\\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660].
Found [1] resource files under the default folder.
Running in [InstallExecutionMode]. Run from TEMP folder at [C:\Users\myuserid\AppData\Local\Temp\Setup00001fb8].
Loaded resource file [C:\Users\myuserid\AppData\Local\Temp\Setup00001fb8\OSETUPUI.DLL] (CultureTag=en-US).
Loaded Dll : \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\PrjPro.WW\OSETUP.DLL.
Catalyst version is : 14.0.4755.1000
JobExecutionMode is InstallExecutionMode.
Check if Office is supported on Windows 6.1.7601
Checking if CLSID_DOMDocument60 can be created.
Checking the version of MSXML6.
MSXML version check passed. Minimum required version is [6.10.1129], installed Version is [6.30.7601.17988].
LIS: start parsing setup xml
LIS: finished parsing LIS package "{90140000-0115-0409-0000-0000000FF1CE}"
LIS: start parsing setup xml
LIS: finished parsing LIS package "{90140000-0116-0409-1000-0000000FF1CE}"
LIS: start parsing setup xml
LIS: finished parsing LIS package "{90140000-003B-0000-0000-0000000FF1CE}"
LIS: start parsing setup xml
LIS: finished parsing LIS package "{90140000-00B4-0409-0000-0000000FF1CE}"
LIS: start parsing setup xml
LIS: finished parsing LIS package "{90140000-002C-0409-0000-0000000FF1CE}"
LIS: start parsing setup xml
LIS: finished parsing LIS package "{90140000-0010-0409-0000-0000000FF1CE}"
Product: PRJPRO
AddOnGroup Culture: en-us
AddOnId: OFFICE.EN-US
AddOnId: PROJECT.EN-US
AddOnId: PROOFING.EN-US
No upgradable applications found
Parsing config.xml at: \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\PrjPro.WW\config.xml
Preferred product specified in config.xml to be: PRJPRO
Parsed setting: SETUP_REBOOT with value: Never in config.xml.
Logging type verbose specified in config.xml.
Log directory: C:\Users\myuserid\AppData\Local\Temp specified in config.xml
Log file template: Microsoft Office Project Professional Setup(*).txt specified in config.xml
COMPANYNAME specified in config.xml.
USERNAME specified in config.xml.
Product Deployment Mode: PerMachineManaged
Target Deployment Account Security Identifier: S-1-5-18
Loading package metadata: \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\Office.en-us\OfficeMUI.xml
Loading package metadata: \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\Office.en-us\OfficeMUISet.xml
Loading package metadata: \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\Proofing.en-us\Proof.es\Proof.xml
Loading package metadata: \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\Proofing.en-us\Proof.fr\Proof.xml
Loading package metadata: \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\Proofing.en-us\Proof.en\Proof.xml
Loading package metadata: \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\Proofing.en-us\Proofing.xml
Loading package metadata: \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\Project.en-us\ProjectMUI.xml
Loading package metadata: \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\PrjPro.WW\PrjProWW.xml
Reading value of unintialized setting!
BRANDING: Parsing Branding Data...
BRANDING: Parsing Branding Data...
Pidkey specified in config.xml or setup.xml file. Skipping PidKey view.
Kicking off chained install...
PERF: TickCount=2434333 Name=Job::DoCacheWork Description=Begin function
OSE is detected as a registered service. Service binary is reported at location: C:\Program Files\Common Files\Microsoft Shared\Source Engine\OSE.EXE
OSE service binary is detected at location: C:\Program Files\Common Files\Microsoft Shared\Source Engine\OSE.EXE
OSE is avaliable at C:\Program Files\Common Files\Microsoft Shared\Source Engine\OSE.EXE
This OSE has version: 12.0.4518.1014. Skip using this version of OSE because its version is too low.
Running Source Engine process detected
Running version: 12.0.4518.1014
Error checking already running ose version. Error code 0x00000000
Stopping running the problematic Source Engine process
Error attaching to OSE, error 0x00000000
Cannot start standalone OSE. from \\path\to\Microsoft Project 2010\SW_DVD5_Project_Pro_2010w_SP1_W32_English_MLF_X17-76660\PrjPro.WW\ose.exe. Error code: 0x80070102
Error: Unable to select Source Engine process to start, see debug level logs for detail Type: 88::UnexpectedError.
Error: Unable to select Source Engine process to start, see debug level logs for detail Type: 88::UnexpectedError.
Error: Unable to select Source Engine process to start, see debug level logs for detail Type: 88::UnexpectedError.
Error: Unable to select Source Engine process to start, see debug level logs for detail Type: 88::UnexpectedError.
Catalyst execution finished: 03/07/2014 13:32:07. Return code: 30088. Exception caught: UnexpectedError.
PERF: TickCount=2511881 Name=RunSetup Description=End function
I've checked a few things but I can't figure this out
restored config.xml
used no msp
Office Source Engine (OSE) service startup type is set to 'Manual'
copied ose.exe again from DVD
copied entire DVD over again
I'm beginning to wonder if there's an issue with the existing Project 2007 installation, or the way it was uninstalled [by the Project 2010 setup] - but maybe its something altogether different.
Any advice is greatly appreciated.My point above is that Project 2007 was extremely buggy and unless files are saved using Project 2007 SP3 first you are likely to experience problems with the files when opening in project 2010. Project 2007 to 2010 with no service packs is problematic.
With SPs applied you should have far fewer problems.
Doesn't look like a exe with SP2 is available yet so you need to add the service pack separately, probably in the updates folder.
If all Project 2007 installs are already at SP3 then no need for this.
Rod Gill
Author of the one and only Project VBA Book
www.project-systems.co.nz -
VBA Runtime Error 1004 "Application-defined or Object-defined error"
I have code VBA code written in MS Access 2010 (.mbd file) to write data into an Excel file (.xls file). Below is the code to write data into that excel file. When you run this code, it always throws Error#1004 "Application-defined or Object-defined
error". When you debug the code (F8) or run it (F5), it runs absolutely fine with out any issues. I am still not able to figure it out on what exactly the issue is. This code works fine when executed in MS Access 2007.
Below is thr code that's getting executed and when it fails, the focus is set on the 3rd last line of the code marked in double astriek mark.
Sub PopulateReport(appExcel As Object, testcam)
Dim Site As String, intRec As Integer, i As Integer, cnt As Integer, intRecSet As Integer, cntr As Integer
Dim F1 As String, F2 As String, F3 As String, F4 As String, F5 As String, F6 As String, F7 As String
Dim F8 As String, F9 As String, F10 As String, F11 As String, F12 As String, F13 As String, CAMDate As Date
Close
i = 0
cnt = 0
cntr = 0
Set cnn = CurrentProject.Connection
rec.Open "SELECT * FROM Site", cnn, adOpenStatic, adLockPessimistic
rec.MoveLast
rec.MoveFirst
intRec = rec.RecordCount
Do Until cnt = intRec
rec.MoveLast
rec.MoveFirst
rec.Move cnt
Site = rec(4)
Select Case Site
Case "Fort Worth"
cntr = 0
recset.Open "SELECT * FROM Employee", cnn, adOpenStatic, adLockPessimistic
recset.MoveLast
recset.MoveFirst
intRecSet = recset.RecordCount
appExcel.Application.Goto Reference:="START_FW_CL"
Do Until cntr = intRecSet - 1
appExcel.Selection.EntireRow.Copy
appExcel.Selection.EntireRow.Insert
cntr = cntr + 1
Loop
appExcel.Application.CutCopyMode = False
appExcel.Application.Goto Reference:="START_FW2_CL"
go = appExcel.Application.Range("START_FW2_CL")
cntr = 1
With appExcel.Worksheets("Accts. > Clearing").[START_FW2_CL]
Do Until recset.EOF
**.Offset(cntr, 0) = recset(0)**
.Offset(cntr, 1) = recset(1)
.Offset(cntr, 2) = recset(2)
End SubWhat's wrong about it? It can only copy what you chose to have in the recordset. If you only want some fields or fields in a different order, replace
SELECT * FROM with
SELECT Field1, Field2, etc
CopyFromRecordset is bay far the best method and runs much faster.
Rod Gill
Author of the one and only Project VBA Book
www.project-systems.co.nz -
We have a single master project resource pool of over 150 resources that are shared across let's say 10-15 sub projects or sharer files.
We are using Microsoft Project Professional (standalone no project server)
Are you aware of any limitations outside of project server with resource pool and sharing, or should we be using Project server (as I have read a lot of articles about resource pool sharing working better in project server)
I'd like to get clarification on:
1. I read that the calendars for resources (of which there could be many shift patterns etc.) should always be created in the master project only, not in the sharer files. In my testing I see that a shared resource also brings the additional calendars from
the Master Project file - and can be chosen in the calendar column from Resource sheet.
2. Each sharer file can have it's own specific project calendar, but the resource calendar (used by the assigned resources from the pool) will drive the scheduling (as per normal), unless;
3. A specific task has a 'Task Calendar' applied to it AND "scheduling ignores resource calendars" is ticked.
I am trying to find an article that addresses, in detail, the limitations or 'look out fors' in this area. I have found plenty about how to create and share resources, but this is more troubleshooting.
Any advice or direction that can be given would be appreciated. Thanks.No limit to resources, but linked master and resource pools are at high risk of file corruption if you rename, over-write or move a linked file without removing it from the master and pool first. Files will corrupt, its when not if.
Master files should never have any resources or tasks in them, only inserted projects.
I much prefer creating master files with the Link option deselected. This copies all data and consolidates resource info (so no pool needed). I record a macro to create new masters each week. This method has no corruption risk.
Your alternative now is to experiment with Project Server. By far the best way to prototype a system is to get Project Online through Microsoft, ProjectHosts or Bemo. It will give you access to a vanilla project server very quickly and cost for a few months
testing is trivial for a few users.
If you go ahead with a full implementation I strongly recommend getting a qualified Project Server partner to help you implement the full system.
Rod Gill
Author of the one and only Project VBA Book
www.project-systems.co.nz
Maybe you are looking for
-
While updating my ipod it crashed and now all I get is the apple logo on the screen.
I clicked on the update operating system that had a notification next to it. It downloaded for a long while then asked me to hook up to itunes. I didi and it said it was downloading again . Then updating. Then said update failed and now all that show
-
HI Experts Plz help Interview questions Regarding WAD,BPS and APD?? Tnks&Reg Sudha
-
Import one tablespace out of exp file
Hello, I 'd would like to know how to import only one tablespace out of an export file. The import went wrong for one TS and I'd like to only retry that particular TS. Tyia, Cheers, A.R
-
HCM Process&Forms EHhP5 "proces is currently not released for execution"
Hallo! After changing the system to EHP5 i got a new error: Process XYZ is currently not released for execution I didn't change the customizing! What should i do? I cannot rember that a process is to activate anywhere. The form and the interface are
-
Iphone not working fully when charging
When charging my iphone freezes a lot until un plugged. I can not answer calls ETC also my alarm is now super quiet but it is not the speakers as if i play the ipod it is fine. Any ideas?