## Project: TimescaledData Method May Return Invalid Data

Q121365

kbprb

The information in this article applies to:

- Microsoft Project for Windows, version 4.0
- Microsoft Project for the Macintosh, version 4.0

## SYMPTOMS

In Microsoft Project, the Visual Basic, Applications Edition, TimescaledData method may return strings with unreadable characters.

## STATUS

Microsoft has confirmed this to be a problem in the Microsoft products that are listed at the beginning of this article.

## MORE INFORMATION

The TimescaledData method returns a list of work or cost for a task and resource over intervals in a period of time. Normally, the method returns a text string that resembles the following:

> 5h,2h,6h,2h,2h

At times, however, the method returns strings that contain unreadable characters such as hearts and happy faces.

### Steps to Reproduce Behavior

1. Enter a task with a 5 day duration and assign a resource, R1.
2. Enter the following macro into a module:

          Dim i As Integer
          Dim Returned_String as String

          Sub BadSting()

              For i = 1 To 10000
                  Returned_String = TimescaledData(1, 1, ActiveProject.Start, _
                               ActiveProject.Finish, pjWork, pjTimescaleDays)
                  Debug.Print Returned_String
                  Test_String
              Next i

          End Sub

          Function Test_String() As Integer

              Dim h_pos, start_pos, s_length As Integer
              Const SearchChar = "H"

              start_pos = 1
              h_pos = InStr(start_pos, Returned_String, SearchChar, 1)

              If h_pos &gt; 0 Then
                  If Not IsNumeric(Left(Returned_String, h_pos - 1)) Then
                      MsgBox "Bad data on loop " &amp; i &amp; "."
                      Stop
                  End If
              End If

          End Function

3. Run the macro.

After the macro runs for a while, it will eventually stop and display a number representing the number of times that the TimescaledData method has been accessed. Also, in the debug window, you will see the data string returned by the TimescaledData method.
NOTE: This problem occurs in a random fashion and does not happen after a set number of iterations.

Additional query words: smiley happyface dingbats ding bats

Keywords :
Issue type : kbbug
Technology : kbHWMAC kbOSMAC kbProjectSearch kbProject400Mac kbProjectMacSearch kbProject400

Last Reviewed: November 5, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use.