Embedding Fonts in Excel

by Allen Wyatt
(last updated August 3, 2017)


If you are familiar with Word and PowerPoint, you may have noticed that both programs allow you to embed fonts in documents or presentations. This is very handy, particularly if you feel that someone else receiving your document or presentation may not have your font on their system.

Unfortunately, Excel does not allow you to embed fonts in workbooks. Word has an intimate relationship with something in concrete reality: the printed page. Almost everything it does is in relationship to how something will be printed, and Word queries the printer driver many times during an editing session in order to represent information accurately onscreen. PowerPoint, as well, makes at least some reference to what can be printed or displayed onscreen.

Excel, on the other hand, is not all that interested in printing because a worksheet is really just a representation of a set of quantities and relationships--things which are fundamentally abstract. In fact, it wasn't until Excel 95 that Excel's default font was changed to Arial (a TrueType font) instead of MS Sans-Serif (a non-scalable screen font whose printing vagaries are legion).

If you really must embed fonts to make your worksheet appear properly, there is one thing you can try: Embed the Excel worksheet in a Word document in which the desired font is also embedded. You will need to make sure, of course, that the font you've chosen is embeddable (some are not). When someone else opens the document, they may see the information as you intended. Of course, they will need to use Word instead of Excel for viewing the information.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (1969) applies to Microsoft Excel 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Using Mail Merge to Complete Documents

Mail merge can be used to put together groups of documents that rely on common information. This tip shows how mail merge ...

Discover More

Understanding the While...Wend Structure

One of the basic programming structures used in VBA is the While ... Wend structure. This structure helps to make the ...

Discover More

Limiting a Calculated Value to a Range

If you want to limit what is returned by a formula to something between lower and upper boundaries, the solution is to ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Slow Excel Response Times

Many people use Excel on a notebook computer, so they can do work at the office and elsewhere. In some situations, Excel ...

Discover More

Viewing Workbook Statistics

Excel keeps track of a range of stats about each workbook you use. If you want to take a look at those stats, it's easy; ...

Discover More

Slowing Down Mouse Selection

Ever tried to select a range of cells using the mouse, only to have the cells scroll by so quickly you can't make the ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven more than 9?

2018-08-07 10:03:38

Santiago Clausse

There's actually a very simple method to embed the font in an Excel file.

1. Create a new sheet called 'fonts'
2. In the fonts sheet Insert > Object > Create from file
Now select your ttf font file, then press OK.

This should now create an object with the name of the font you inserted and a .ttf extension.

3. Select the object, and rename it to the same name as the font, including the .ttf. For example: Linearicons-Free.ttf

4. Add the following VBA code to the 'ThisWorkbook' object in the Visual Basic editor ( Developer > Visual Basic)

' force explicit variable declaration
Option Explicit

' set default array subscripts to 1
Option Base 1

' 32bit & 64bit dec's
#If VBA7 And Win64 Then
Private Declare PtrSafe Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFilename As String) As LongPtr
Private Declare PtrSafe Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFilename As String) As LongPtr
Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFilename As String) As Long
Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFilename As String) As Long
#End If

' // copy the OLE objects out to the users "temp" Folder & install the Fonts as a resource upon opening the Workbook
Private Sub Workbook_Open()

' // vars
Dim objFont As OLEObject
Dim objFilename As String
Dim objShell As Object
Set objShell = CreateObject("shell.application")
Dim objFolder As Variant
Set objFolder = objShell.Namespace(Environ("Temp") & Application.PathSeparator)
Dim objFolderItem As Variant
Set objFolderItem = objFolder.Self

' // copy out the OLE objects from the "fonts" Worksheet into a temp Folder
For Each objFont In Worksheets("fonts").OLEObjects
' // get the Filename of each Font Object
' Please note: you must set this yourself when you add embed the Fonts
objFilename = objFont.Name
' // Copy the Font to the Clipboard
' // Paste the Font from the Clipboard to the "temp" Folder
If Dir(CStr(Environ("Temp") & Application.PathSeparator & objFilename), vbDirectory) = vbNullString Then
objFolderItem.InvokeVerb ("Paste")
End If
' // add each Font as a resource in Excel
AddFontResource Environ("Temp") & Application.PathSeparator & objFilename
Next objFont

' fixes Excel 2013 update fonts issue
Application.ScreenUpdating = False: ActiveSheet.Select: Application.ScreenUpdating = True

' // clean up
Set objFont = Nothing
Set objShell = Nothing

End Sub

' // remove the Font resource upon closing the Workbook
Private Sub Workbook_BeforeClose(Cancel As Boolean)

' // vars
Dim objFont As OLEObject
Dim objFilename As String

' // loop the OLE objects in the "fonts" Worksheet
For Each objFont In Worksheets("fonts").OLEObjects
' // set the Filename
objFilename = objFont.Name
' // remove the resource
RemoveFontResource Environ("Temp") & Application.PathSeparator & objFilename
Next objFont

' // clean up
Set objFont = Nothing

End Sub

And that's it! Now run the Private Sub Workbook_Open() and you should have the font embedded.

This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.