VBA Code for MS Access 2013 to import Excel 2013 files and add additional data

MicheleArenburg

New Member
Joined
Nov 7, 2016
Messages
3
I am looking for a VBA code that will import an Excel spreadsheet, time stamp it, username stamp it, filename stamp it, (in separate fields).
Also, I need to prevent the same file from being able to be imported more than once.
Complete with Error Handling please.

I have tried the standard "DoCmd.TransferSpreadsheet" type code however, I need the details above handled as well.

My table tblPointsAwarded has these fields:
ID
OFFER
DESCRIPTION
Points
AccNum
Username (for stamp)
File Name (as imported by the user)
Data and Time (for Import time stamp)

Thank you , I appreciate any and all assistance with this.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
you can use Transferspreadsheet,
or
attach the spreadsheet as a linked table,
build a query to import the external table to your internal one,
add your needed fields to the query: userID, Filename, etc.
put these additional items on a form, frmImport, then the query can use the form items as fields to add.
 
Upvote 0
thanks for that,
I do have a need to eliminate the "human error" side of the data entry.. so I need to have the filename especially get picked up via coding to eliminate that. Also, I need to prevent the same file from being imported more than once.
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top