I've decided to do an automaton, and it'll be whole new question that never ask by anyone else in internet.
Currently, My working flows is looklike this:
Import data to Access --> calculate everything --> Exit Access, Open Excel --> refresh all data and use Automaton outlook to send email (vba excel)
now I want to change it into this:
Import data to access --> calculate everything then open excel file that attached in table1 (inside attachment field), refresh all data (that connected directly to Access itself already) then save and close excel (save change into attachment field)
--> on Form, choose group to report, access open excel and run macro that prepaired in Excel file (excel still invisible), calling outlook automaton
--> new email appear, close excel file.
if you guy could advice any better method, I'll follow the light. Right now, I want to know how to do my new idea that just pop up in my mind :D
sothat, what vba code to manipulate attachment field ?
how to open excel attachment inside vba, run excel macro ?
how to close excel attachment and save it back with any modify into attachment field ? :D
Edit 1:
my current code:
Currently, My working flows is looklike this:
Import data to Access --> calculate everything --> Exit Access, Open Excel --> refresh all data and use Automaton outlook to send email (vba excel)
now I want to change it into this:
Import data to access --> calculate everything then open excel file that attached in table1 (inside attachment field), refresh all data (that connected directly to Access itself already) then save and close excel (save change into attachment field)
--> on Form, choose group to report, access open excel and run macro that prepaired in Excel file (excel still invisible), calling outlook automaton
--> new email appear, close excel file.
if you guy could advice any better method, I'll follow the light. Right now, I want to know how to do my new idea that just pop up in my mind :D
sothat, what vba code to manipulate attachment field ?
how to open excel attachment inside vba, run excel macro ?
how to close excel attachment and save it back with any modify into attachment field ? :D
Edit 1:
my current code:
Code:
Public Function MAttachment(RefreshAll As Boolean, Optional InputField As String)
Dim Rcs As Recordset2
Dim Rcs1 As Recordset2
Dim fld As DAO.Field2
Dim FullFileName As String
FullFileName = "D:\(REPORT) Tracking Volume and Price WholeSale LRB.xlsb"
Set Rcs = CurrentDb.OpenRecordset("SELECT * from TblExcel")
Set fld = Rcs("AttachExcel")
Set Rcs1 = fld.Value
If FileExists(FullFileName) Then
Kill FullFileName
End If
Rcs1("FileData").SaveToFile "D:\"
If RefreshAll = True Then
If RefreshExcel(FullFileName) = True Then
Rcs1("FileData").Delete
Rcs1("FileData").AddNew
Rcs1("FileData").LoadFromFile FullFileName
Rcs1.Update
End If
end if
end function
Comment