Sub Test() Dim pal As Palette Set pal = Palettes.CreateFromDocument("Document Colors", _ Application.UserDataPath & "Palettes\DocColors.xml", True) MsgBox "The document uses " & pal.ColorCount & " colors" pal.CloseEnd Sub