Visio Guy

Visio Discussions => Programming & Code => Topic started by: tverbeke on May 15, 2018, 08:36:25 AM

Title: Generating Report in Visio 2016 fails but works in Visio 2010
Post by: tverbeke on May 15, 2018, 08:36:25 AM
Dear Forum,

I'm posting my first post because of this strange issue i'm experiencing in Visio 2016 (O365).

If we run the code below we get an error message 'report definition invalid' but if we run the exact code in Visio 2010 it works perfectly.

Any thoughts ?

I've tried the following actions:


Public Sub RapportViso_PowerBus()
    Select Case MsgBox("Export Only this worksheet?", vbYesNoCancel, "Export Visio PowerBus Data")
        Case 6
            'YES
            Visio.Application.Addons("VisRpt").Run ("/rptDefName=\\fileserver\PRIVATE\ENG\ELEC\13-Visio\DataShapes_Stencils\Powerbus_on_page.vrd")
        Case 7
            'NO
            Visio.Application.Addons("VisRpt").Run ("/rptDefName=Q:\ENG\ELEC\13-Visio\DataShapes_Stencils\Powerbus_on_page_TotalProject.vrd")
        Case 2
            'CANCEL
    End Select
End Sub

Public Sub RapportViso_AsiData()
    Select Case MsgBox("Export Only this worksheet?", vbYesNoCancel, "Export Visio Asi Data")
        Case 6
            'YES
            Visio.Application.Addons("VisRpt").Run ("/rptDefName=Q:\ENG\ELEC\13-Visio\DataShapes_Stencils\All devices full on page.vrd")
        Case 7
            'NO
            Visio.Application.Addons("VisRpt").Run ("/rptDefName=Q:\ENG\ELEC\13-Visio\DataShapes_Stencils\All devices full on page_TotalProject.vrd/rptOutput=EXCEL")
        Case 2
            'CANCEL
    End Select
End Sub
Title: Re: Generating Report in Visio 2016 fails but works in Visio 2010
Post by: Croc on May 15, 2018, 10:05:32 AM
1. Try to run the report through the wizard (Run addon / Report... / ... vrd)
2. Publish the .vrd file here.