I've searched all around and can't seem to find exactly the answer I'm looking for regarding what I'm trying to do.
I have a macro I've setup within access that I want to essentially open an excel file every time I run it, pause for 10 seconds, then save and close the excel file. Now I'm guessing this isnt very hard to do via VBA code but I'm not well versed yet in it. Heres how I have it setup so far... I can't seem to get the save and close part down.
Action: RunApp - I set the arguement to open excel and my file, this seems to work fine.
Action: RunCode - I have created a module with the following public function I found via post on this forum that lets me set the pause time:
Code:
Public Function Pause(NumberOfSeconds As Variant)
On Error GoTo Err_Pause
Dim PauseTime As Variant, Start As Variant
PauseTime = NumberOfSeconds
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Exit_Pause:
Exit Function
Err_Pause:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_Pause
End Function
I then enter the arguement Pause(seconds)
Now the next part is where I get hung up, I can't seem to find a way to get the excel file (and application) to save and close. Can this be done through the simple macro commands in access or wiill I need to create additional code?
Thanks in advance