Thanks acron,
I was actually trying at first to put all the code in Excel, but I know very little about this.
I have the following VB code, but it won't run as VBA code. I run into trouble with the section "set WshNetwork = WScript.CreateObject("WScript.Network"

" line.
Option Explicit
Sub addPrinter()
Const printer = "\\mkntsad1\ap_hp4050"
Dim Text, Title, icon
Dim WshNetwork ' Object variable
Title = "Mackenzie Information Technologies - Printer Mapping Script"
' Create a new WshNetwork object to access network properties.
Set WshNetwork = WScript.CreateObject("WScript.Network"
On Error Resume Next
WshNetwork.AddWindowsPrinterConnection printer
Select Case Err.Number
Case 0
Text = "Printer connected to """ & printer & """."
icon = vbInformation
Case -2147023688
Text = "Error: Network resource """ & _
printer & """ doesn't exist."
icon = vbCritical
Case -2147024811
Text = "Error: Mapping to """ & printer & """ already exists."
icon = vbCritical
Case Else
Text = "Error: Code " & Err.Number & " " & Err.Description
icon = vbCritical
End Select
On Error GoTo 0 ' Enable run-time error handling.
MsgBox Text, vbOKOnly + icon, Title
'*** End
End Sub