Run saved import spec in VBA

hockeyfan21

Registered User.
Local time
Today, 08:56
Joined
Aug 31, 2011
Messages
38
Thought this would be easy, but getting error message

Want to run an import spec that imports and appends data from Excel to my Access table. I ran the import process, saved the import spec, naming it "Import-PGI_Data" then, in my VBA for my button:

DoCmd.RunSavedImportExport "Import-PGI_Data"

I keep getting "argument not optional" error.

What am I missing?

Thanks!

Toni
 
Howzit

I don't know much about this but the syntax looks fine - although I have not used in anger until now. You can definitely see the import on the External tab under "saved imports"?

Using the same syntax as you I do not get your error, even if I delete the destination table. I get a different error when I delete the source file.
 
Well that wasn't very smart, I typed the syntax with a "," between the two lines but, when I posted my question, left it out, which apparently is how it should work :) Took the comma out of my vba and all is fine. Thanks!
 

Users who are viewing this thread

Back
Top Bottom