none
Run a saved Import spec from VBA code

    Question

  • Need to run a saved Import spec from VBA code. 

    Have been trying the DoCmd.TransferSpreadsheet but my Excel fields are Memo size.  Transfer only brings the first 255 characters. The only way I've been able to get the entire fields passed in is to use a saved Import spec.  How can I automate this in VBA.  If I try the transgfer methods I've seen here, inspecting each cell for <>"" and importing within a loop, then I still get only 255 chars.  I'm much more used to manipulating dynasets than calling these functions but it looks like a job for Dir level commands.  Thanks.

    Monday, June 27, 2011 4:43 PM

Answers

  • You can use:

     

    docmd.RunSavedImportExport "name of saved import/export"

     

     

    • Marked as answer by Bruce Song Friday, July 08, 2011 12:39 PM
    Tuesday, June 28, 2011 11:36 PM
  • Try using the OUTPUTTO method instead.  That function can use export specifications.
    John Spencer Access MVP 2002-2005, 2007-2011 The Hilltop Institute University of Maryland Baltimore County
    • Marked as answer by Bruce Song Friday, July 08, 2011 12:39 PM
    Monday, June 27, 2011 5:14 PM

All replies