adding resources to the resource sheet in ms project using vba 
Author Message
 adding resources to the resource sheet in ms project using vba

I have created a form with combo boxes that are populated
from three small Access tables. I am trying to populate
certain fields within an MS Project Resource sheet based
upon the values that are selected from the combo boxes. I
get a run-time error because there are no previous values
in any of the fields within the rows that I am trying to
populate in the resource sheet. Is there anyway to add
info to fields within the resource sheet using VBA code? I
do not wish to import data into the resource sheet using a
map. This is a sample similar to the code I have written:

    Count = ThisProject.Resources.Count
    Call InsertResource
    Count = Count + 1
    ThisProject.Resources.Item(Count).StandardRate = TOTAL

Where InsertResource is a Macro to insert a new resource
that looks something like this:
    ViewApply Name:="Resource Sheet"
    SelectRow Row:=1
And where TOTAL is variable storing a formula derived from
values within the access db based upon the combo box
selections.

Any ideas on how to insert an entirely new resource into
the resource sheet (if there are no values in any of the
fields for the row to be inserted) would be greatly
appreciated.

Thanks!

Beth



Sun, 06 Feb 2005 01:17:48 GMT  
 adding resources to the resource sheet in ms project using vba
Hi,

Try:

Dim R as Resource
Set R=Activeproject.Resources.Add "Resource Name"
R.StandardRate=Total

--

Visit www.mvps.org/project/ for the Project MVP's FAQ and third party
add-ons

Rod Gill
Microsoft Project MVP
Visit www.projectlearning.com for customized Project and Office VBA macros
and Project companion software


Quote:
> I have created a form with combo boxes that are populated
> from three small Access tables. I am trying to populate
> certain fields within an MS Project Resource sheet based
> upon the values that are selected from the combo boxes. I
> get a run-time error because there are no previous values
> in any of the fields within the rows that I am trying to
> populate in the resource sheet. Is there anyway to add
> info to fields within the resource sheet using VBA code? I
> do not wish to import data into the resource sheet using a
> map. This is a sample similar to the code I have written:

>     Count = ThisProject.Resources.Count
>     Call InsertResource
>     Count = Count + 1
>     ThisProject.Resources.Item(Count).StandardRate = TOTAL

> Where InsertResource is a Macro to insert a new resource
> that looks something like this:
>     ViewApply Name:="Resource Sheet"
>     SelectRow Row:=1
> And where TOTAL is variable storing a formula derived from
> values within the access db based upon the combo box
> selections.

> Any ideas on how to insert an entirely new resource into
> the resource sheet (if there are no values in any of the
> fields for the row to be inserted) would be greatly
> appreciated.

> Thanks!

> Beth



Mon, 07 Feb 2005 11:38:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Project Window Activation from Resource Sheet if any

2. Replace project resources with pool resources

3. Adding resources to Global Resource Pool

4. Adding Icon to MS Project using VBA

5. After adding tasks outside of MS Project, saving in MS Project deletes them

6. Resource Files...adding and using images.....................

7. booking a resource then changing the meeting resource

8. Getting a drop down resource list when filtering by resource and date range

9. Resources in a resource pool in date range

10. Reading Resources and Resource properties in macros

11. Shared Resources/Resource Pool

12. Making a Resource file, or Data resource in a Module

 

 
Powered by phpBB® Forum Software