Hi all,
I have created a database that imports mulitple spreadsheets as needed.
An Import button on my form brings up another form that lists the Excel files that I can import.
It works for my past databases but when I click Import and it brings up my second form it says 'Run Time Error 2522- The action or method requires a File Name argument'
It is debugging to the line highlighted in purple;
Basically I need to know if this can be fixed?
I've looked up multiple sites about this error and they mention things about your register etc. but I don't have access on this computer to check my registry. Can this be fixed in any simpler way?
Many Thanks,
Eavie
I have created a database that imports mulitple spreadsheets as needed.
An Import button on my form brings up another form that lists the Excel files that I can import.
It works for my past databases but when I click Import and it brings up my second form it says 'Run Time Error 2522- The action or method requires a File Name argument'
It is debugging to the line highlighted in purple;
Private Sub cmdRunImport_Click()
On Error GoTo errHandler
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "temporary_data", pubPath(1) & lstExcelFiles.Value, False, pubRange(1)
appImport
DoCmd.OpenForm "frmSubmitKH08", acNormal
DoCmd.Close acForm, "frmImportKH08"
errHandler:
If Err.Number > 0 Then
If Err.Number = 3011 Then
MsgBox "The Spreadsheet " & lstExcelFiles.Value & " is not in the format required for import"
ElseIf Err.Number = 3274 Then
MsgBox "The Workbook " & lstExcelFiles.Value & " is protected. Unprotect the Workbook for Import."
Else
MsgBox Err.Number & vbCrLf & Err.Description
End If
End If
End Sub
Basically I need to know if this can be fixed?
I've looked up multiple sites about this error and they mention things about your register etc. but I don't have access on this computer to check my registry. Can this be fixed in any simpler way?
Many Thanks,
Eavie