[英]Excel VBA: Use a sheet from the same workbook?
The scenario: I have an Excel workbook with a macro that uses a template (from " C:\\Users\\User1\\Desktop\\1.xltx
") to create customized sheets. 方案:我有一个Excel工作簿,其中包含使用模板的宏(来自“
C:\\Users\\User1\\Desktop\\1.xltx
”)来创建自定义工作表。
The problem: I need to make Excel to use the template from the same workbook - I have added the template as a separate sheet ("temp1"). 问题:我需要使Excel才能使用同一工作簿中的模板-我已将模板添加为单独的工作表(“ temp1”)。 I can't seem to figure it out, even though it's probably very simple.
即使看起来很简单,我似乎也无法弄清楚。
The current code: 当前代码:
Set wks = Sheets.Add(After:=Worksheets(Worksheets.Count), Type:="C:\Users\User1\Desktop\1.xltx")
You probably don't want individual copies of the template for each user. 您可能不需要每个用户的模板的单独副本。 If something on the template changes, you would have to update every copy.
如果模板上的某些内容发生更改,则必须更新每个副本。
Have you thought of talking to your SysAdmin and storing the template (1.xltx) in a common location with Read Only permission for the users? 您是否考虑过与SysAdmin进行交谈并将模板(1.xltx)存储在具有用户只读权限的公共位置?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.