分发 Excel 内置的 Office 应用程序 - 多个版本,从旧版本复制数据
我正在开发一个项目,我们希望能够将 Excel 电子表格部署给多个用户,然后随着项目的进展能够将该电子表格更新为不同版本。基本上 Excel 是用户界面,我们正在调用几个 .NET 4.0 .dll,它们使用 VBA 代码完成繁重的工作。
我找到了有关 Microsoft ClickOnce 技术的信息,它看起来很有前途。
http://msdn.microsoft.com/en-us/library/ff961899.aspx
我设想的问题涉及实际电子表格的更新。用户将填充许多数据工作表,每次我们发布新版本时,他们都必须将所有数据复制粘贴到新程序中。
有谁知道我们可以使用类似启用宏的模板之类的方法,我们将在 ClickOnce 解决方案中部署该模板,然后我们可以从用户最新的工作簿链接到该模板?我们的想法是,只要我们只添加功能而不移动东西,我们就可以继续前进,而不会给用户带来巨大的不便?
任何想法将不胜感激。
I'm working on a project where we'd like to be able to deploy an Excel spreadsheet to multiple users, and then be able to update that spreadsheet to different versions as the project progresses. Basically Excel is the user interface, and we are calling several .NET 4.0 .dll's that do the heavy lifting using VBA code.
I found information on Microsoft's ClickOnce technology and it looks very promising.
http://msdn.microsoft.com/en-us/library/ff961899.aspx
The problem that I'm envisioning involves the update of the actual spreadsheet. Users will be populating many worksheets of data, and every time we release a new version, they'll have to copy paste all the data into the new program.
Does anyone know of a way that we could use something like a macro enabled template that we'd deploy in the ClickOnce solution, that we could then link to from the users latest Workbook? The thought being that as long as we only added features and didn't move things around, we could move forward without huge inconveniences to the user?
Any ideas would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除了使用插件之外,您还应该
- 确保您的代码对所有单元格引用使用定义的名称,以便保护您的代码免受用户插入/删除行的影响
- 在每个工作簿中以定义的名称存储版本号(通过代码),以便您的代码可以在发生重大更改时采取适当的操作
In addition to using an addin you should
- ensure your code uses defined names for all references to cells so that your code is protected from the user inserting/deleteing rows
- store a version number in a defined name in every workbook(via code) so that your code can take appropriate action if there are breaking changes
听起来您需要将代码放入插件中并分发它。这将解决将代码与数据分离的问题。
It sounds like you need to put your code into an addin and distribute that. That would solve the problem of separating your code from the data.