Unable to Create a Copy of the View Sheet in NI DIAdem

Updated Mar 31, 2025

Reported In

Software

  • DIAdem

Issue Details

Unable to copy the sheet from the View Panel in NI DIAdem.

Solution

Copying the VIEW sheet in NI DIAdem is not natively supported.

However, you can use the following script as a workaround to achieve this functionality:

vbscriptCopyEditOption Explicit  ' Forces explicit declaration of all variables.
Dim ActiveSheetIndex, i, n, n1, n2
i = 0
ActiveSheetIndex = View.Activesheet.Index
n = View.Sheets.Count

' Save the current layout to a temporary file
Call View.SaveLayout("C:\Users\Public\Documents\National Instruments\DIAdem 2024\Documents\Example.tdv")

' Append the saved layout to create a copy of the active sheet
Call View.AppendLayout("C:\Users\Public\Documents\National Instruments\DIAdem 2024\Documents\Example.tdv")

' Calculate the range for removing unwanted sheets
n1 = n + 1
n2 = n * 2

' Remove all sheets except the copied active sheet
For i = n2 To n1 Step -1
  If Not (i = ActiveSheetIndex + n) Then
    Call View.Sheets.Remove(i)
  End If
Next