I want to make a macro that copies two sheets in a new workbook. But the theme color in the new created workbook is different.
Sub Export_File()
Dim Wb3 As Wo
An alternative way to transfer the theme would be to save the source theme as a temp xml and load that file into the destination theme.
DestWB.Colors = SourceWB.Colors
Dim TempThemeFile As String
Dim sourceTheme As Microsoft.Office.Core.ThemeColorScheme
set sourceTheme = sourceWorkbook.Theme.ThemeColorScheme
'Late binding alternative:
'Dim sourceTheme As Object
'Set sourceTheme = SourceWB.Theme.ThemeColorScheme
TempThemeFile = Environ$("temp") & "\xltheme" & Format(Now, "dd-mm-yy h-mm-ss") & ".xml"
sourceTheme.Save TempThemeFile
DestWB.Theme.ThemeColorScheme.Load TempThemeFile
Kill TempThemeFile