I'm trying to export an Access report to Excel and then add some labels and formulas that do not export. My first roadblock is that Access VBA doesn't recognize the value in the formatting command:
.Underline = xlUnderlineStyleNone
My current error message is:
"Unable to set the Underline property of the Font Class"
Any help with this issue will be greatly appreciated.
Thanks, Mike
-----------------------------------------------------------
Dim oApp As Object
DoCmd.OutputTo acReport, "qryCurrentQtrStats", "MicrosoftExcel(*.xls)", "c:\hvma\FY2002_Turnover_Dashboard\CurrentQtrStats.xls", False, ""
Set oApp = CreateObject("Excel.Application"
oApp.Visible = True
'Open the Workbook
oApp.Workbooks.Open "C:\hvma\FY2002_Turnover_Dashboard\CurrentQtrStats.xls"
oApp.Rows("1:1".Select
oApp.Selection.Insert Shift:=1
oApp.ActiveCell.FormulaR1C1 = "FY2002 Quarter"
oApp.Range("A1".Select
oApp.Selection.Font.Bold = True
With oApp.Selection.Font
.Name = "MS Sans Serif"
.Size = 24
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
.Underline = xlUnderlineStyleNone
My current error message is:
"Unable to set the Underline property of the Font Class"
Any help with this issue will be greatly appreciated.
Thanks, Mike
-----------------------------------------------------------
Dim oApp As Object
DoCmd.OutputTo acReport, "qryCurrentQtrStats", "MicrosoftExcel(*.xls)", "c:\hvma\FY2002_Turnover_Dashboard\CurrentQtrStats.xls", False, ""
Set oApp = CreateObject("Excel.Application"
oApp.Visible = True
'Open the Workbook
oApp.Workbooks.Open "C:\hvma\FY2002_Turnover_Dashboard\CurrentQtrStats.xls"
oApp.Rows("1:1".Select
oApp.Selection.Insert Shift:=1
oApp.ActiveCell.FormulaR1C1 = "FY2002 Quarter"
oApp.Range("A1".Select
oApp.Selection.Font.Bold = True
With oApp.Selection.Font
.Name = "MS Sans Serif"
.Size = 24
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With