VBA Excel 到 MS 项目
VBA 新手,我成功地从 Excel 导入和读取任务列表和资源,在 Excel 中执行 VBA 并将这些记录插入到 MS Project 中。我正在考虑设置 ActiveProject.Resources.Standardrate = "100p/h"
,但是出现错误。
正在应用的代码(归功于之前为 Stackoverflow 上的其他相关问题提供的以下代码的答案)。
If Not ExistsInCollection (newproject.Resources, strResource) Then
newproject.resources.add.name = StrResource <-- This works, resources are added.
' However, inserting the following line:
newproject.resources.standardrate = "100p/h" <-- It errors here
End if
非常感谢任何帮助 - 谢谢。
New to VBA, I am successfully importing and reading a Task List and Resources from Excel, executing VBA in Excel and inserting these records into MS Project. I am looking at setting the ActiveProject.Resources.Standardrate = "100p/h"
, however I am getting an error.
The code being applied (credit to previous answers provided to other related questions on Stackoverflow for the following code).
If Not ExistsInCollection (newproject.Resources, strResource) Then
newproject.resources.add.name = StrResource <-- This works, resources are added.
' However, inserting the following line:
newproject.resources.standardrate = "100p/h" <-- It errors here
End if
Any assistance is greatly appreciated - Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该代码需要进行较小的修改以获取对新添加的资源的引用,以便可以更新标准率。
该代码还演示了如何处理逗号限制资源列表的情况,而不是单个资源。
The code needed a minor modification to get a reference to the newly-added resource so that the StandardRate can then be updated.
This code also demonstrates how to handle the case of a list of comma-delimited resources rather than a single one.