Automating Data Import From Excel

N

neilla81

Hi all-- there's a large number of threads on this topic in the
archives, which has yielded (what seems to be) working VBA code that
will let the user pick an Excel workbook from which to import a range
of data. My problem is that I don't understand, conceptually, where
to insert relevant VBA such that the user can start the process. For
instance, I'd like to be able to process

---
strLocation = GetFile()

If Len(strLocation) > 0 Then
DoCmd.TransferSpreadsheet acImport, _
acSpreadsheetTypeExcel9, "Evaluations", _
strLocation, False, "IT-Contracted!B13:D95"

DoCmd.TransferSpreadsheet acImport, _
acSpreadsheetTypeExcel9, "Evaluations", _
strLocation, False, "IT-Contracted!F13:G95"
End If
---

where the function GetFile is defined in a module and appears to work
correctly. How can I put the user in a position to call this code? I
*was* a programmer in a former life, but it was a while ago and I have
almost zero experience in VBA syntax.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top