共享工作簿时不会复制图表 [英] Chart Does not Copy when Workbook is Shared

查看:213
本文介绍了共享工作簿时不会复制图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Excel 2013。

Excel 2013.

我有一个VBA程序,它循环工作簿并将工作簿中的一系列数据复制到主工作簿(VBA模块所在的工作簿)  数据范围包括表格和图表。 如果未共享工作簿
,则代码可以正常工作,但在共享工作簿时不会复制图表(选中"允许多个用户进行编辑")。 我很困惑为什么会发生这种情况。

I have a VBA procedure that cycles through workbooks and copies a range of data from the workbooks into the master workbook (in which the VBA module resides).  The range of data includes a table and a chart.  The code works fine when the workbook is not shared, but does not copy the chart when the workbook is shared (with "Allow multiple users to edit" checked).  I am perplexed why this is happening.

执行复制的代码如下所示,部分复制包含表格和图表的范围以粗体显示。

The code that does the copy is below, with the part that copies the range that includes the table and chart in bold.

      strRange = "A1:T20"
      strRange2 = "A" + Trim(Str(I)) + ":T" + Trim(Str(I + 20))
      'Copy the Dashboard table and chart into Master Dashboard in this book.
      wb.Worksheets("Dashboard").Range(strRange).Copy ThisWorkbook.Sheets("Master Dashboard").Range(strRange2)

Doug Pruiett

Doug Pruiett

推荐答案

从测试开始,在共享的Excel工作簿中,似乎无法选择图表。 因此,当我选择包含表格和图表的范围时,仅在共享工作簿时选择(并随后复制和粘贴)表格。 
任何人都可以共享复制图表的代码并将其粘贴到另一个工作簿中吗? 谢谢你的帮助。
From testing, it appears that in a shared Excel workbook, charts are cannot be selected.  Hence when I select the range that includes the table and the chart, only the table is selected (and subsequently copied and pasted) when the workbook is shared.  Can anyone share code that would copy a chart and paste it in another workbook?  Thanks for the help.


这篇关于共享工作簿时不会复制图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆