Hello,
I am trying to get the headers of the exported data from Access97 to excel to be verticle but it does not seem to be liking my orientation line. The code itself works without error just wont flip the headers.
Here is my code:
Private Sub cmdSelect1_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qmakUsageAllDataSys"
DoCmd.OutputTo acOutputQuery, "qryCrossTabSys", acFormatXLS, "M:\DATA\EXCEL\ManualDataUsage.xls", False
Dim objExcel As Excel.Application
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add
objExcel.sheets(1).Select
objExcel.Range("A1:AA1").Select
objExcel.Range("A1:AA1").Orientation = 90
objExcel.Visible = False
objExcel.DisplayAlerts = False
objExcel.Workbooks(1).Save
objExcel.DisplayAlerts = True
objExcel.Quit
Set objExcel = Nothing
MsgBox "This file has been created"
End Sub
Thank you.
I am trying to get the headers of the exported data from Access97 to excel to be verticle but it does not seem to be liking my orientation line. The code itself works without error just wont flip the headers.
Here is my code:
Private Sub cmdSelect1_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qmakUsageAllDataSys"
DoCmd.OutputTo acOutputQuery, "qryCrossTabSys", acFormatXLS, "M:\DATA\EXCEL\ManualDataUsage.xls", False
Dim objExcel As Excel.Application
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add
objExcel.sheets(1).Select
objExcel.Range("A1:AA1").Select
objExcel.Range("A1:AA1").Orientation = 90
objExcel.Visible = False
objExcel.DisplayAlerts = False
objExcel.Workbooks(1).Save
objExcel.DisplayAlerts = True
objExcel.Quit
Set objExcel = Nothing
MsgBox "This file has been created"
End Sub
Thank you.