A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access 2007 - DoCmd.RunCommand acCmdImport



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2008, 09:21 PM posted to microsoft.public.access
deko
external usenet poster
 
Posts: 34
Default Access 2007 - DoCmd.RunCommand acCmdImport

in Access 2003, I used "DoCmd.RunCommand acCmdImport" as part of a routine
to make importing data from Excel spreadsheets easier. After upgrading to
Access 2007 it no longer works.

Error Number 2002: You tried to perform an operation involving a function or
feature that was not installed in this version of Microsoft Access.

is there an equivalent way to programmatically open the "Get External Data"
dialog in 2007?

Thanks in advance.

  #2  
Old June 2nd, 2008, 10:14 PM posted to microsoft.public.access
Rui
external usenet poster
 
Posts: 63
Default Access 2007 - DoCmd.RunCommand acCmdImport

could it be: "DoCmd.TransferText acCmdImport" the command you are looking for?

Rui

"deko" wrote:

in Access 2003, I used "DoCmd.RunCommand acCmdImport" as part of a routine
to make importing data from Excel spreadsheets easier. After upgrading to
Access 2007 it no longer works.

Error Number 2002: You tried to perform an operation involving a function or
feature that was not installed in this version of Microsoft Access.

is there an equivalent way to programmatically open the "Get External Data"
dialog in 2007?

Thanks in advance.


  #3  
Old June 2nd, 2008, 10:55 PM posted to microsoft.public.access
Klatuu
external usenet poster
 
Posts: 7,074
Default Access 2007 - DoCmd.RunCommand acCmdImport

Not for Excel.
Use the TransferSpreadsheet method.
Docmd.TransferSpreadsheet.

See VBA Help for details on how to use it.
--
Dave Hargis, Microsoft Access MVP


"Rui" wrote:

could it be: "DoCmd.TransferText acCmdImport" the command you are looking for?

Rui

"deko" wrote:

in Access 2003, I used "DoCmd.RunCommand acCmdImport" as part of a routine
to make importing data from Excel spreadsheets easier. After upgrading to
Access 2007 it no longer works.

Error Number 2002: You tried to perform an operation involving a function or
feature that was not installed in this version of Microsoft Access.

is there an equivalent way to programmatically open the "Get External Data"
dialog in 2007?

Thanks in advance.


  #4  
Old June 3rd, 2008, 10:47 AM posted to microsoft.public.access
Rui
external usenet poster
 
Posts: 63
Default Access 2007 - DoCmd.RunCommand acCmdImport

sorry, I didn't notice the excel bit.

"Klatuu" wrote:

Not for Excel.
Use the TransferSpreadsheet method.
Docmd.TransferSpreadsheet.

See VBA Help for details on how to use it.
--
Dave Hargis, Microsoft Access MVP


"Rui" wrote:

could it be: "DoCmd.TransferText acCmdImport" the command you are looking for?

Rui

"deko" wrote:

in Access 2003, I used "DoCmd.RunCommand acCmdImport" as part of a routine
to make importing data from Excel spreadsheets easier. After upgrading to
Access 2007 it no longer works.

Error Number 2002: You tried to perform an operation involving a function or
feature that was not installed in this version of Microsoft Access.

is there an equivalent way to programmatically open the "Get External Data"
dialog in 2007?

Thanks in advance.


  #5  
Old June 3rd, 2008, 11:22 AM posted to microsoft.public.access
deko
external usenet poster
 
Posts: 34
Default Access 2007 - DoCmd.RunCommand acCmdImport

DoCmd.RunCommand acCmdImportAttachExcel

This is what I was looking for. Works great.

I like the [ Do you want to overwrite table 'tblYourTable'? ] warning when
importing Excel worksheets as tables that have the same name as an internal
table. In Office 11 there was no warning and I had databases destroyed by
mistaken overwrites. I resorted to opening a one-record recordset on each
internal table (about 50 tables) and leaving them open until the import was
complete. This effectively locked the table and prevented any chance of
overwrite. I still have this code in place to be on the safe side.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.