PaneNext Problem

J

Jeff

When I run the following code it executes, but returns only the word
"Resource Name" in my excel spreadsheet.

As you can see from the commented code, I have tried all sorts of
things to get this to work. The "PaneNext" Command does not seem to be
working.

HELP!!!

JEff
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sub TrasferTimescaleData()
Const intervalType As Integer = pjTimescaleWeeks
Const dataType As Integer = pjWork

'Link to Excel
Dim Xl As Excel.Application, XlSheet As Worksheet
Set Xl = CreateObject("Excel.Application")
Set XlSheet = Xl.Workbooks.Add.ActiveSheet

'Copy Left Table
'SelectRange 1, 2: SelectAll: EditCopy
'XlSheet.Paste XlSheet.Cells(2, 1)

'Transfer Table Headings
Dim i As Integer, Heading As String
For i = 1 To ActiveSelection.FieldNameList.Count
XlSheet.Cells(1, i) = ActiveSelection.FieldNameList(i)
Next

'Copy Time Scale Data
Dim TSValues As TimeScaleValues
Dim noColumns As Integer, startCol As Integer
ViewApply Name:="Resource &Usage"

'TimescaleEdit intervalType, intervalType
'DetailStylesRemoveAll
'DetailStylesAdd Item:=dataType
'Set TSValues =
ActiveProject.ProjectSummaryTask.TimeScaleData(ActiveProject.ProjectStart,
ActiveProject.ProjectFinish, , intervalType)
'noColumns = TSValues.Count
'PaneNext
SelectResourceColumn Column:="name"
OutlineHideSubTasks
'SelectColumn Column:=3
'ToggleAssignments
'SendKeys "^{HOME}"
TimescaleEdit MajorUnits:=2, MajorLabel:=9, Separator:=True,
MajorUseFY:=True, TierCount:=1
PaneNext
SelectTimescaleRange Row:=1, StartTime:="Fri 7/2/04", Width:=40,
Height:=1046917
'SendKeys "^{C}"
EditCopy
'EditCopy startCol
=XlSheet.Cells.SpecialCells(xlCellTypeLastCell).Column 1
'AppActivate ("Microsoft Excel")
'Xl.Workbooks.Add
'Application.ActivateMicrosoftApp (pjMicrosoftExcel)
'XlSheet.Paste XlSheet.Cells(2, startCol)



'Finally, Just a little formatting
XlSheet.Rows(1).Font.Bold = True
XlSheet.Range("A1",
XlSheet.Cells.SpecialCells(xlCellTypeLastCell).Address).EntireColumn.AutoFit
Xl.Visible = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top