You also do not turn the warnings back on.
You also do not turn the warnings back on.
If this helped, please click the star * at the bottom left and add to my reputation- Thanks
No added line, just add a single quote like this:
' On Error GoTo ImportIt_Err
Now when running the code, a dialog box should pop up with an option button to debug. Click that and the VBE should open with the error line highlighted.
I believe you can just use
Code:Delete * FROM RawAudit
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
I dropped that line in but when I try to import, no additional dialog box appears...
You have 4 people posting suggestions. When you post back, it would be very helpful to know what post or person you are replying to.
I assume you are replying to my post #17, which you should read again. No added line, just modify the existing line by adding the single quote.
Yes I was replying to you. Sorry.I assume you are replying to my post #17, which you should read again. No added line, just modify the existing line by adding the single quote.
Okay that makes sense. I added that single quote and the debugger is keying on ln 26:
DoCmd.RunSavedImportExport "Import-PHI"
I figured it out. The workbook name needs to match the file name in the import. Jeez.
Thank you all!!!
OK, that's a saved import specification that gives Access the details of how to import the data.csv file. It contains an error. The specification is within the DB, but not shown in your post.
You'll need to import your DB here for someone to trouble shoot that. We will also need a sample data.csv file and a copy of the spreadsheet that you are trying to export to.
try this code if you want to programatically change the xml in the saved import.
Code:'?CurrentProject.ImportExportSpecifications(0).XML Sub ChangeImportPath(StrNewPath As String, strSpecName As String) On Error GoTo Err_Handler ' MSXML2 requires reference to "Microsoft XML, v6.0" ' earlier versions are probably compatible, remember to use the appropriate ' DOMDocument object version. ' code borrowed from Jason Hardman's contribution at this link: ' https://stackoverflow.com/questions/...9e56e187f953f7 Dim XMLData As MSXML2.DOMDocument60 Dim ImportSpec As ImportExportSpecification Dim XMLNode As IXMLDOMNode 'Dim StrNewPath As String ' Get XML object to manage the spec data Set XMLData = New MSXML2.DOMDocument60 ' existing Import Specification (should be set up manually with relevant name) Set ImportSpec = CurrentProject.ImportExportSpecifications(strSpecName) XMLData.LoadXML ImportSpec.XML ' change it's path to the one specified With XMLData.DocumentElement .setAttribute "Path", StrNewPath End With ImportSpec.XML = XMLData.XML ' run the updated import 'Debug.Print CurrentProject.ImportExportSpecifications(0).XML ImportSpec.Execute Exit_Handler: Set ImportSpec = Nothing Set XMLData = Nothing Exit Sub Err_Handler: Select Case err.Number Case 3011 MsgBox "Replacement path is invalid", vbCritical 'Profile name is wrong or MS Exchange server is offline Case Else MsgBox err.Number & " - " & err.Description & vbCrLf _ & "Please take note of the error code and contact your System Administrator", vbCritical End Select Resume Exit_Handler End Sub
If this helped, please click the star * at the bottom left and add to my reputation- Thanks