I am frustrated and baffled by how to modify a document's "Normal" style.
I've got a macro that saves a subset of the sheets in a given document as a new document. In order for the printing to match, I believe, the new document has to have the same "Normal" style font as the old one. So I'm trying to write a macro that copies the master doc's style into the new doc. I want this portable, so I don't want to hard-code a particular choice for the font.
My master document has "Normal" with the Arial font.
I have the code:
[vba]
Set NewBook = Application.Workbooks.Add
With NewBook.Styles("Normal").Font
.Name = ThisWorkbook.Styles("Normal").Font.Name
.Size = ThisWorkbook.Styles("Normal").Font.Size
.Bold = ThisWorkbook.Styles("Normal").Font.Bold
End With
[/vba]
And for some unknown reason, the very first line of this, adding a new workbook, causes the master document's "Normal" style to change to Calibri. Or at least that's what the watched variable says in the debugger. The appearance of the master document has not changed. I abort the macro after the above line of code and try (in the Immediate window):
[vba]Debug.Print ThisWorkbook.Styles("Normal").Font.Name[/vba]
...and get Arial again.
Why? What's going on?