M
miao jie
Hi
Now I'm try to export weekly resourece work hours to Excel file. firstly, I need write the column head for each of work week. my Code as follow
Dim TSV As TimeScaleValues, HowMany As Lon
Dim first As Date, last As Dat
first = ActiveProject.ProjectStar
last = ActiveProject.ProjectFinis
Set TSV = ActiveCell.Resource.TimeScaleData(first, last, Type:=pjResourceTimescaledActualWork, TimescaleUnit:=pjTimescaleWeeks
'Set TSV =Application.ActiveCell.Resource.TimeScaleData(frist, last, pjResourceTimescaledWork, pjTimescaleWeeks
For HowMany = 1 To TSV.Coun
rgt
xlCol = TSV(HowMany).StartDate & " - " & TSV(HowMany).EndDate -
Next HowMan
Firstly, the code is running good, but several time later
when VBA excute to Set TSV = ....... , the system tell me a error message as follow
Run-time error '1004
Application-definded or object definded erro
I'm really confuse it, anyone can help me out, thanks very much
Now I'm try to export weekly resourece work hours to Excel file. firstly, I need write the column head for each of work week. my Code as follow
Dim TSV As TimeScaleValues, HowMany As Lon
Dim first As Date, last As Dat
first = ActiveProject.ProjectStar
last = ActiveProject.ProjectFinis
Set TSV = ActiveCell.Resource.TimeScaleData(first, last, Type:=pjResourceTimescaledActualWork, TimescaleUnit:=pjTimescaleWeeks
'Set TSV =Application.ActiveCell.Resource.TimeScaleData(frist, last, pjResourceTimescaledWork, pjTimescaleWeeks
For HowMany = 1 To TSV.Coun
rgt
xlCol = TSV(HowMany).StartDate & " - " & TSV(HowMany).EndDate -
Next HowMan
Firstly, the code is running good, but several time later
when VBA excute to Set TSV = ....... , the system tell me a error message as follow
Run-time error '1004
Application-definded or object definded erro
I'm really confuse it, anyone can help me out, thanks very much