简体   繁体   English

Excel VBA创建Visio组织结构图

[英]Excel VBA to create Visio Org Chart

My boss has asked me to try to figure out a way to automate our company's org charts. 我的老板请我尝试找出一种使我们公司的组织结构图自动化的方法。 They have been using Visio and would like to continue. 他们一直在使用Visio,并希望继续。 So far they just take the previous years drawings and go in and manually do the changes to all of the positions. 到目前为止,他们只是采用前几年的图纸,然后手动对所有位置进行更改。 SO far I have taken all of the employee data, put it into an excel workbook, given each employee a unique ID number, and created a reports to column to put the ID number of the person each employee reports too. 到目前为止,我已经获取了所有员工数据,将其放入excel工作簿中,为每个员工提供了唯一的ID号,并创建了一个报告列以将每个员工也要报告的人员的ID号也放入列中。 With that I can make the org charts in visio by importing data. 这样,我可以通过导入数据在visio中制作组织结构图。 I have two problems though: 我有两个问题:

  1. Visio makes orgcharts for every worksheet in the workbook. Visio为工作簿中的每个工作表创建组织结构图。 My boss wants to keep all of the past org chart data in one workbook, so I do not want to recreate every years org charts by importing the excel workbook. 我的老板希望将所有过去的组织结构图数据保存在一个工作簿中,因此我不想通过导入excel工作簿来重新创建每年的组织结构图。

  2. The structure is not very good in Visio. Visio中的结构不是很好。 I don't know if there is a way to get Visio to put the boxes in order by how I have them listed in Excel but that would be helpful. 我不知道是否有一种方法可以使Visio通过在Excel中列出它们的方式来对它们进行排序,但这会有所帮助。 I have several people who report to one person, but one of them should be placed higher than the other (so in excel they would be directly the second row). 我有几个人向一个人报告,但是其中一个应该比另一个人高(因此,在Excel中,他们将直接位于第二行)。 Visio places people randomly through out their level of the hierarchy. Visio将人们随机放置在整个层次结构中。

I am new to VBA but have done a few small projects with it and a lot of research. 我是VBA的新手,但是已经用它做了一些小项目,并做了很多研究。 I am wanting to know if anyone has any idea how to use VBA to create structured org charts in Visio using Excel data. 我想知道是否有人知道如何使用VBA使用Excel数据在Visio中创建结构化的组织结构图。 (Also we have the 2016 excel version but only the 2010 Visio version so that has been a bit of road block). (此外,我们还有2016年的excel版本,但只有2010年的Visio版本,因此有点路障)。 Any help on this would be greatly appreciated! 任何帮助,将不胜感激!

The Visio OrgChart wizard can round trip data. Visio OrgChart向导可以往返数据。 You can use an Excel file to create a Visio OrgChart, modify it and then export the information back to Excel but... The OrgChart wizard randomly places the individuals on the page so whatever order you tried to put in the Excel file is lost. 您可以使用Excel文件创建Visio OrgChart,对其进行修改,然后将信息导出回Excel,但是... OrgChart向导将个人随机放置在页面上,因此您尝试放入Excel文件的任何顺序都会丢失。 There is a 3rd party OrgChart wizard that will respect your order, but I do not have the details at hand. 有一个第三方OrgChart向导会尊重您的订单,但是我手边没有详细信息。 As to the version issue, you will have to save the Excel file in an older format that Visio 10 can handle. 对于版本问题,您将必须以Visio 10可以处理的旧格式保存Excel文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM