Groundrush
Registered User.
- Local time
- Today, 09:15
- Joined
- Apr 14, 2002
- Messages
- 1,376
Each week I manually export a db qry into an exel spreadsheet and as expected the spreadsheet size on average increases by about 273 records
Last week the spreadsheet size was 3,127kb but when I use the database to export the data the size increases to 70.6mb
The only difference is that this time I imported the data using the code below
Is there a way to compress the spreadsheet or change it so it doesn't hog up the email system when i try & send these out?
thanks
Last week the spreadsheet size was 3,127kb but when I use the database to export the data the size increases to 70.6mb
The only difference is that this time I imported the data using the code below
Code:
Private Sub cmdForecastReport_Click()
DoCmd.SetWarnings True
Dim strQryName As String, strFilename As String, strDirectory As String, strFileDir As String
Dim appXL As New Excel.Application
Dim appXLBook As Excel.Workbook
Dim db As Database
Set db = CurrentDb()
strQryName = "qryProjectedIncomeForecast" 'Change to your query
strFilename = "Projected Income Forecast.xls" 'change to what you want to call the file
strDirectory = "P:\Database Cost reports\Forecast Reports" 'change to the folder you want
strFileDir = strDirectory & "\" & strFilename
DoCmd.OutputTo acOutputQuery, strQryName, acFormatXLS, strFileDir, False
Set appXLBook = GetObject(strFileDir)
Set appXL = appXLBook.Parent
appXL.Visible = True
appXLBook.Windows(1).Visible = True
appXL.DisplayAlerts = False
appXL.Columns("B:B").Select 'Change this to the column(s) you want formatted "0.00"
appXL.Selection.NumberFormat = "0.00"
appXL.Range("A1").Select
appXL.ActiveWorkbook.Save
DoCmd.SetWarnings True
End Sub
Is there a way to compress the spreadsheet or change it so it doesn't hog up the email system when i try & send these out?
thanks