help with a function

J

Janis

I need help to make this function create an excel file. It would be helpful
also to get the data from the updated record into the sheet first. Thanks

Private Sub Form_AfterUpdate()
Const STRPATH = "c:\Test"
Const STRFILENAME = "Emp.xls"
Const OPEN_EXISTING = 3&
If Dir(STRPATH) = "" Then
' Create directory

Else
If STRPATH & "\" & STRFILENAME = "" Then


CreateFile(STRPATH, 0, 0, ByVal 0&, OPEN_EXISTING, 0, ByVal 0&) =
Me.xlsOutput.worksheets("Emp.xls")

End If


End Sub

Private Declare Function CreateFile& Lib "kernel32" Alias "CreateFileA"
(ByVal STRPATH As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As
Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal
dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long)
End Function
 
Top