As to your questions:
via tools? No but instead using code similar to what I will post
at the end of this. Once you open a spreadsheet in Excel from Access
you can do about 90% of the things that you can do in Excel itself.
What I usually do is go step by step. Export the file into the
spreadsheet. the separate from Access open Excel and create a macro and
do all of the operations that I want access to do. Then edit that
macro, select all and copy it into a function inside an access module.
From the example you can see that in most cases the instructions end up
being the same but simply have the es (in my case) in front of each.
That seems to work better for me than using the "with" function that is
available.
Some of the excell functions/actions have not worked for me this way,
but you can also have a macro in that base spreadsheet that is copied
and you can execute the macro from within access, so that can get
around that part. My range in the copy has J600 as the end because I
know that I will never have near 600 entries being exported. The
.visible property says whether or not you can see excell do it. I have
found a couple of excell functions that need a yes/no reply need to be
visible to run. I have not been able to find a workaround for some of
them, which simply means I can't find the workaround yet, not that it
is not there. Sometimes in testing I will make visible true just so I
can watch it work and see where I may be making a mistake.
The example has both the excell part and the creation of an email with
attachment.
2) about getting the data back in. Yes that is how I would handle, If
you extracted the data from 5 tables, then you will need to be able to
turn around and run as many update queries as required to turn around
and overlay fields in the tables that you want to update with the new
information. Obviously the key will be that you will need to have in
that spreadsheet (now a returing table) any information you will need
to properly identify which record in which table needs to be updated.
This may entail record keys that could be hidden/locked to the excell
user but would be necessary for you to properly identify which record
to update.
Deleting lines out of the spreadsheet will not obviously delete lines
out of the tables, you will have to figure out some other flag system
to do that if that is going to be allowed.
3) The key in all of this is play around with doing it in macros and
then expanding on the code, once you begin to feel comfortable with
what you are doing. Until you get it all down pat, you obviously need
to backup your tables and starting spreadsheet so that you do not need
to restart from 0 or recreate tables.
=====================================================
VBA.FileCopy MasterDir & "Time Analysis Ding Master.xls", ReportDir
& ReportFileName
ReportFileName = ReportDir & ReportFileName
DoCmd.TransferSpreadsheet _
TransferType:=acExport, _
SpreadsheetType:=acSpreadsheetTypeExcel9, _
TableName:="Query - All Employee Ding Only", _
Filename:=ReportFileName, _
HasFieldNames:=True, _
Range:="ExportData"
Set es = CreateObject("Excel.Application")
es.Visible = False
es.Workbooks.Open Filename:=ReportFileName
es.Sheets("Master Analysis Tab").Select
es.Range("B2:B2").Select
es.ActiveCell.FormulaR1C1 = Now()
es.Range("B4:B4").Select
es.ActiveCell.FormulaR1C1 = strtdate
es.Range("D4
4").Select
es.ActiveCell.FormulaR1C1 = EndDate
es.Range("F4:F4").Select
es.ActiveCell.FormulaR1C1 = NumDings
es.Sheets("ExportData").Select
es.Range("A2:J600").Select
es.Selection.Copy
es.Sheets("Master Analysis Tab").Select
es.Range("A7").Select
es.ActiveSheet.Paste
es.Range("A1:A1").Select
es.ActiveWorkbook.Save
es.ActiveWorkbook.Close (False)
es.Application.Quit
If Forms![HiddenKey]![HKCreateEmail] = True Then
Set o = CreateObject("Outlook.Application")
Set m = o.CreateItem(0)
m.To = (e-mail address removed)
m.Subject = "Time Analysis report as of " & Date
m.bodyformat = 2
m.htmlbody = "<body><br><br>" & _
"<b> Date: " & Date & " </b><br><br></body>"
' if you don't want the html/rtf format then drop the bodyformat
and load m.body instead.
m.attachments.Add ReportFileName
m.display
End If