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:
oApp.Underline = xlUnderlineStyleNone
Access sees xlUnderlineStyleNone as an ubdefined variable. My code so far is listed below.
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
oApp.Name = "MS Sans Serif"
oApp.Size = 24
oApp.Strikethrough = False
oApp.Superscript = False
oApp.Subscript = False
oApp.OutlineFont = False
oApp.Shadow = False
oApp.Underline = xlUnderlineStyleNone
oApp.ColorIndex = 1
End With
oApp.Underline = xlUnderlineStyleNone
Access sees xlUnderlineStyleNone as an ubdefined variable. My code so far is listed below.
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"
oApp.Selection.Insert Shift:=1
oApp.ActiveCell.FormulaR1C1 = "FY2002 Quarter"
oApp.Range("A1"
oApp.Selection.Font.Bold = True
With oApp.Selection.Font
oApp.Name = "MS Sans Serif"
oApp.Size = 24
oApp.Strikethrough = False
oApp.Superscript = False
oApp.Subscript = False
oApp.OutlineFont = False
oApp.Shadow = False
oApp.Underline = xlUnderlineStyleNone
oApp.ColorIndex = 1
End With