Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-10-2015, 02:50 AM
pascalbidouille pascalbidouille is offline Personal fields in Export/visual reports Windows 7 64bit Personal fields in Export/visual reports Office 2013
Novice
Personal fields in Export/visual reports
 
Join Date: Jun 2015
Posts: 18
pascalbidouille is on a distinguished road
Default

Hi Julie, happy you're back. you had good holidays ?



I did investigate on the vba side and manage a macro to do it.
Info in your link would probably have saved me some time, but I still succeeded in extracting data.

Here is my code if anyone may need it
Code:
Sub lire_tache_heure()

Dim tache As Task
Dim taches As Tasks
Dim ressource As Assignment
Dim projet As Project
Dim jour As Date
Dim debut As Date
Dim fin As Date
Dim book
Dim feuille
Dim l As Long
Dim c As Long

Set projet = ActiveProject

Set taches = ActiveSelection.Tasks
Set tache = projet.Tasks.UniqueID(0)
debut = tache.Start
fin = tache.Finish
Set excelappli = CreateObject("Excel.application")
excelappli.Application.workbooks.Add
Set feuille = excelappli.Application.activeworkbook.sheets(1)
feuille.cells.ClearContents
l = 1
c = 5
excelappli.Visible = True
jour = debut
feuille.cells(1, 1).Value = "tache"
feuille.cells(1, 2).Value = "ressource"
feuille.cells(1, 3).Value = "ref1"
feuille.cells(1, 4).Value = "ref2"
While jour < (fin - 1)
    feuille.cells(1, c).Value = jour
    jour = jour + 1
    c = c + 1
Wend

For Each tache In projet.Tasks
    If tache.UniqueID <> 0 Then
        For Each ressource In tache.Assignments
            l = l + 1
            c = 5
            'Debug.Print tache.Name; ressource.ResourceName;
            feuille.cells(l, 1).Value = tache.Name
            feuille.cells(l, 2).Value = ressource.ResourceName
            feuille.cells(l, 3).Value = tache.Text2
            feuille.cells(l, 4).Value = tache.Text3
            jour = debut
            
            While jour < fin - 1
                feuille.cells(l, c).Value = Val(ressource.TimeScaleData(StartDate:=jour, EndDate:=jour + 1, Type:=8, TimeScaleUnit:=4, Count:=1).Item(1).Value) / 60
                
                jour = jour + 1
                c = c + 1
            Wend
        Next
    End If
Next

End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Personal fields in Export/visual reports Visual Reports OTPM Project 3 02-12-2015 08:54 AM
Filtered Visual Reports OTPM Project 3 01-27-2015 07:39 AM
Personal fields in Export/visual reports generating visual reports ketanco Project 1 07-19-2014 12:01 PM
Resource Usage view does not correctly export to a Visual Report cergon Project 3 04-25-2014 06:10 AM
Personal fields in Export/visual reports Visual Reports (custom) Quinton Project 3 03-29-2012 08:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft