S
sverre
Hi,
I have a module with VBA code that works fine, but I want the code to be
executed/called on from a macro as I have other tasks in the macro to be
executed
directly after the vba-code. I thought I could use "openmodule" in a macro
but that seem only to open the vba code in design view, not run it.
The macro in which I would like to add my VBA-code is executed from a
command-button on click by the way. The VBA looks like below:
Best regards Sverre
IMPORT ()
Dim strFolder As String
Dim strFile As String
strFolder =
"\\fspa\fileroot\DFS.8803.gemdisk\Projekt\Refaet\MAP\Avstämning_SESAM_Jeevesextrakt\extraktimport\"
strFile = Dir(strFolder & "*.txt")
Do While Len(strFile) > 0
' Put your code to import strFolder & strFile here
DoCmd.TransferText acImportFixed, "Bokföringsextrakt_import_spec",
"bokföringen mxg", strFolder & strFile, False
strFile = Dir()
Loop
End Sub
I have a module with VBA code that works fine, but I want the code to be
executed/called on from a macro as I have other tasks in the macro to be
executed
directly after the vba-code. I thought I could use "openmodule" in a macro
but that seem only to open the vba code in design view, not run it.
The macro in which I would like to add my VBA-code is executed from a
command-button on click by the way. The VBA looks like below:
Best regards Sverre
IMPORT ()
Dim strFolder As String
Dim strFile As String
strFolder =
"\\fspa\fileroot\DFS.8803.gemdisk\Projekt\Refaet\MAP\Avstämning_SESAM_Jeevesextrakt\extraktimport\"
strFile = Dir(strFolder & "*.txt")
Do While Len(strFile) > 0
' Put your code to import strFolder & strFile here
DoCmd.TransferText acImportFixed, "Bokföringsextrakt_import_spec",
"bokföringen mxg", strFolder & strFile, False
strFile = Dir()
Loop
End Sub