5 Replies Latest reply on Jul 1, 2014 2:36 PM by Asle Frantzen

    VBA: Setting ScaleFormat for trend traces?

    Asle Frantzen

      Hi

       

      In a project we have a specified that all values should have one decimal, including the trends.

       

      Some trends I reset programatically, before I add the traces using the correct new context. Regardless of the configuration of the trends, it seems the ScaleFormat is removed when I remove all the traces.

       

      In the trend configuration dialog I can set the format for each of the traces, but according to the documentation for ProcessBook VBA it seems the ScaleFormat can only be set for the entire trend - not each trace individually. I'm assuming (based on the documentation) that ScaleFormat is the corresponding VBA setting for what I want to accomplish.

       

       

       

      Can anyone tell me how I set the number format so that it applies to all traces in the trend? I need "0,0" - as in one decimal.

       

      Thanks!

        • Re: VBA: Setting ScaleFormat for trend traces?
          dhollebeek

          Trend.ScaleFormat works on individual traces just like the definition dialog.  For a lot of the Trend methods, you have to set Trend.CurrentTrace first.  In order to set the number format so that it appears on all traces you would loop through all the traces (1 through Trend.TraceCount), set Trend.CurrentTrace to that index and then set Trend.ScaleFormat each time in the loop.

           

          I hope I understood the question and that works for you :).

           

          :D