Below is my code to run and post my query results in Excel. The code pastes NULL as 0. I would like the NULLs to be a pasted as "NULL". I think some type of paste values would work or changing my table from a ".QueryTable" may help. I am not sure what to do. Any suggestions?
'Import Data
With queryOutputWS.ListObjects.Add(SourceType:=0, Source:=Array(Array( _
"ODBC;DRIVER=SQL Server;SERVER=W51SQP-********;Trusted_Connection=Yes;APP=Microsoft Office 2010" _
), Array(";DATABASE=*****")), Destination:=queryOutputWS.Range("A1")).QueryTable
.CommandText = myQuery
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.PreserveColumnInfo = False
.ListObject.DisplayName = "Query"
.Refresh BackgroundQuery:=False
End With
queryOutputWS.ListObjects("Query").Unlist