Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Sub Export_Data() Dim rst As DAO.Recordset Dim xlApp As Object Dim xlWB As Object Dim xlWs As Object Dim xlRng As Object Dim strTblName As String Dim strXLFileName As String Dim I As Long strTblName = "YAV_FORECAST" strXLFileName = "C:\VSS Excel Export\" & Month(Format(Now, "mm")) & " VSS Results" Set rst = CurrentDb.OpenRecordset(strTblName) Set xlApp = CreateObject("Excel.Application") Set xlWB = xlApp.Workbooks.Add(xlWBATWorksheet) Set xlWs = xlWB.Worksheets(1) Set xlRng = xlWs.Range("A1") For I = 0 To rst.Fields.Count - 1 xlRng.Offset(, I).Value = rst.Fields(I).Name Next I xlRng.Offset(1).CopyFromRecordset rst rst.Close Set rst = Nothing Set xlRng = xlWs.UsedRange With xlRng .Font.Name = "Verdana" .Font.Size = 8 With .Borders .ColorIndex = xlAutomatic .LineStyle = xlContinuous .Weight = xlThin End With With .Rows(1) .Font.Bold = True .Interior.ColorIndex = 15 End With .WrapText = False .EntireColumn.AutoFit End With xlWB.SaveAs strXLFileName, True xlApp.Visible = True Set xlApp = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Altering a forms controls text properties to a non-Latin language in Access 2010||13||34|
|Access 2013 - User getting error when exporting preview reports from their machines.||18||52|
|need count any combinaton of 4 numbers||7||25|
|Search functions & INDEX Match||11||21|
Join the community of 500,000 technology professionals and ask your questions.