none
MS Threat Modelling Tool- export report to Excel RRS feed

  • Question

  • Is it possible to enable Report format to Excel? This would be very useful to track threats and promote to risk items
    Wednesday, July 12, 2017 12:13 PM

All replies

  • You can do it manually.

    Open the file and go to the Analysis view, then select the threats that you want to copy; at this point, you'll find a couple of actions in the context menu, to copy threats. Pick one of them and go to Excel: paste and voilà! Your threats are there.

    I am not aware of any solution to directly export threats as a file. The only option is to use the Report functionality to export the threats as HTML document.

    • Proposed as answer by simonec Thursday, July 20, 2017 7:39 AM
    Thursday, July 20, 2017 7:37 AM
  • Well you can import the TMT XML file into Excel and gain access to all of the data that is used to create the report.

    Using VBA it would look something like this:

                              

        Dim xmlFilePath As Variant
        Dim oList As ListObject
        Dim i As Integer
        Dim sdltmtWorksheet As Worksheet

        'Let the user select the correct TM7 file to load
        xmlFilePath = Application.GetOpenFilename _
             (FileFilter:="TMT 2016,*.TM7,TMT 2014,*.TM4", _
             Title:="Open SDL Threat Modeling Tool File", MultiSelect:=False)
        If TypeName(xmlFilePath) = "Boolean" Then Exit Sub

        'Add the SDLTMT sheet
        Application.DisplayAlerts = False
        Application.ScreenUpdating = False

        Set sdltmtWorksheet = Worksheets.Add(After:=Worksheets(Worksheets.Count))
        sdltmtWorksheet.Name = "SDLTMT"
        Set sdltmtWorksheet = Worksheets("SDLTMT")

        'Load the XML file into the table
        ActiveWorkbook.XmlImport URL:=xmlFilePath, ImportMap:=Nothing, Overwrite:=True, Destination:=Range("$A$1")
        Worksheets("SDLTMT").ListObjects(Worksheets("SDLTMT").ListObjects.Count).Name = "XMLtable"
        Application.DisplayAlerts = True

        ' Clean up the xml table by deleting all the graphic related entries
        Set oList = Worksheets("SDLTMT").ListObjects("XMLtable")
        RowCount = oList.DataBodyRange.Rows.Count

        For i = RowCount To 1 Step -1
            If oList.DataBodyRange.Cells(i, 2) = "DRAWINGSURFACE" Then
                oList.ListRows(i).Delete
            End If
        Next

        'Kill the first 68 columns that are blank
        For i = 1 To 68
            oList.ListColumns(1).Delete
        Next

    Note: Since Excel 2013 MS has jacked up the screen updating, even when ScreenUpdating is disabled (as it is in the code), so you will see the screen flashing and also it will take about 10X longer to import than it would using Excel 2010.

    Friday, July 28, 2017 4:06 PM