开发者

Excel 2007 VBA ApplyTheme Addin

开发者 https://www.devze.com 2023-01-23 17:13 出处:网络
I am trying to set the workbook theme using VBA code. ActiveWorkbook.ApplyTheme(\"C:\\Users\\Chris\\AppData\\Roaming\\Microsoft\\Templates\\Document Themes\\MyTheme.thmx\")

I am trying to set the workbook theme using VBA code.

ActiveWorkbook.ApplyTheme("C:\Users\Chris\AppData\Roaming\Microsoft\Templates\Document Themes\MyTheme.thmx")

This works but I don't know how to create a path to the "Document themes" folder which will for work all users?

Than开发者_开发知识库ks Chris


You can get the user's application data folder using the Environ function:

Dim themeFolder As String
themeFolder = Environ("APPDATA") & "Microsoft\Templates\Document Themes"
0

精彩评论

暂无评论...
验证码 换一张
取 消