Hello, I am exporting a query from access to excel and its working but I cant figure out why im getting the green arrows in the corners of two rows of text/numbers that i exported. The exported data looks like 1-1/32" or 1-0/32" and If I mouse on the green arrow it says
Text Date with 2-Digit Year
Convert XX to 19XX
Convert XX to 20XX
Ignore Error
Ect.....
Text Date with 2-Digit Year
Convert XX to 19XX
Convert XX to 20XX
Ignore Error
Ect.....
Code:
Sub ExportToExcelXLS()
'********************************************************************************
' Exports a file named [QC_Production_Export_MM-dd-yyyy.xls] to the desktop.
'********************************************************************************
Dim outputFileName As String
Dim XL As Object
outputFileName = "C:\Documents and Settings\" & Environ("username") & "\Desktop\QC_Production_Export_" & Format(Date, "MM-dd-yyyy") & ".xls"
If Len(Dir$(outputFileName)) > 0 Then
Kill outputFileName
End If
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_ExportToExcel", outputFileName, True
Set XL = CreateObject("Excel.Application")
XL.Workbooks.Open outputFileName
XL.Visible = False
With XL
.Range("E2:E1000").NumberFormat = "h:mm AM/PM" 'specified Time format was showing 1/0/1900
.ErrorCheckingOptions.NumberAsText = False 'Clears the green error arrows
.Range("A1:T1").Font.Bold = True
.Range("A1:T1").Font.Name = "Segoe UI Light"
.Range("A1:T1").Font.Size = 12
.Range("A1:T1").Interior.ColorIndex = 44 'http://dmcritchie.mvps.org/excel/colors.htm
.Range("A2:T1000").Font.Name = "Segoe UI Light"
.Range("A2:T1000").Font.Size = 10
.Columns("A:T").EntireColumn.AutoFit 'Auto fits colums to the largest text
End With
XL.ActiveWorkbook.Save
XL.Application.Quit
Set XL = Nothing
MsgBox "Congrats your data has been uploaded to your desktop in a .xls file", vbInformation, "Upload Complete"
End Sub