Create shape report by macro

Started by Kranich, June 15, 2015, 02:00:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kranich

Dear all,

I have already seen lots of posts here and on other pages but unfortunately I never found a solution.

I'd like to start the report generation in a vba-macro using the following code:

Quote Visio.Application.Addons("VisRpt").Run ("/rptDefName=Warnings_akt.vrd/rptOutput=EXCEL")

I always get the error message: "Error while generating the report. The reportdefinition is not valid".

Any ideas?

Thanks!

Kai

Kranich

Hey all,

I found the solution by myself. I'll write it here, so others can be more successful when having the same problem.

There has to be a blank space after the rptDefName=XXXXXX. The correct line of code is:

QuoteVisio.Application.Addons("VisRpt").Run ("/rptDefName=Cable_akt /rptOutput=EXCEL")

Best wishes
Kai

TheJavaLearner

#2
I get an error when using the code that was posted.  Excel 2010 says "Object required."  I'm not sure what the issue is here.  I changed the report definition to the name of the report I see when I click Review -> Shape Reports.  The name of the report in the column Report is what I used for the definition.  I kept the output as the same, EXCEL.  What does the "VisRpt" do?  Is there something that I need to download or no?  Also, I only have Visio Standard edition so I'm not sure if that's what the problem is or not.  Any help would be great.


UPDATE:
I followed this link and added a reference in excel:

http://www.mrexcel.com/forum/excel-questions/651691-create-visio-document-excel-using-visual-basic-applications.html

This fixed the error that I mentioned above but I now have an error that says "Activex component can't create object."  Has anyone ever seen this before?  I can't seem to find a solution to this on the internet anywhere.

wapperdude

Visio 2019 Pro