PDA

View Full Version : export styles



lior03
12-12-2005, 11:50 AM
hello
is it possible through vba to export styles from one workbook to another?
i mean beside merge the workbooks.
thanks

mdmackillop
12-12-2005, 12:23 PM
I found the following, or is this what you're trying to avoid?

From http://office.microsoft.com/en-gb/assistance/HA011101991033.aspx

Merging styles from other workbooks

When you create a new style, you can use it only in the workbook where you create it ? the new style is saved in the current workbook and won't appear in other workbooks. (This way, you won't mix up styles for your stock portfolio with those for your college expense budget.) However, you can copy or merge styles from other workbooks into the current workbook.



Merging is a powerful tool, but you should use it with some caution. If the workbook into which you merge styles has matching style names, the new styles can override those existing styles and be applied throughout your workbook. Merge styles from other Excel workbooks



Open the source workbook (the workbook you want to copy styles from) and the destination workbook (the workbook you want to copy the styles to).
Activate the destination workbook
On the Format menu, click Style.
Click Merge.
In the Merge Styles from box, select the name of the workbook you want to copy styles from (the source workbook), and then click OK.
Excel copies all the styles from the source workbook to the destination workbook. If the source workbook contains formatting styles that have the same names as styles in the destination workbook, a warning message will appear asking whether you want to merge the styles with matching names anyway. If you click Yes, the styles will be merged, and the source styles will be applied throughout the workbook.

Note The Undo command cannot reverse the effects of the merge. Be sure you want to copy over all the styles from the source workbook to the destination workbook. You may also want to delete any unwanted styles before you start the merge.