VB Code in invoke "Get External Data" window (1 Viewer)

tinyevil777

Registered User.
Local time
Today, 13:28
Joined
Dec 10, 2010
Messages
137
Morning all!

The title explains it all... I have designed a database that's being used by people in my team, however we have an issue with people using compatibility packs. Menus don't show up for some users, and these menus are vital as they need the "Get External Data" function.

Does anybody know of a code to literally invoke the "Get External Data" window?

Data import format needs to be Excel by the way.

Thank you in advance!


Tom
 

tinyevil777

Registered User.
Local time
Today, 13:28
Joined
Dec 10, 2010
Messages
137
See example :)
 

Attachments

  • ged.JPG
    ged.JPG
    55.7 KB · Views: 1,257

vbaInet

AWF VIP
Local time
Today, 13:28
Joined
Jan 22, 2010
Messages
26,374
I believe that's

docmd.runcommand accmdimport

Why not create a custom menu for your application instead and include the import button in there. Custom menus are a standard before deploying apps.
 

tinyevil777

Registered User.
Local time
Today, 13:28
Joined
Dec 10, 2010
Messages
137
Do custom menus display even if they're running a compatibility pack? If they do, then i will look down that route also! Thanks for your reply!
 

vbaInet

AWF VIP
Local time
Today, 13:28
Joined
Jan 22, 2010
Messages
26,374
Hang on a minute, that's Access 2007 or 2010 isn't it? It's a custom ribbon you need.

Yes, custom menus or ribbons tag along with the database.
 

tinyevil777

Registered User.
Local time
Today, 13:28
Joined
Dec 10, 2010
Messages
137
Just tried that code, and it says "you have tried to run an operation involving a function or feature that was not installed in this version of Microsoft Office Access"

What am i missing?
 

vbaInet

AWF VIP
Local time
Today, 13:28
Joined
Jan 22, 2010
Messages
26,374
That code would have worked in Access 2003. These are all the 2007 constants associated with Runcommand:

acCmdImportAttachAccess
acCmdImportAttachdBase
acCmdImportAttachExcel
acCmdImportAttachHTML
acCmdImportAttachLotus
acCmdImportAttachODBC
acCmdImportAttachOutlook
acCmdImportAttachParadox
acCmdImportAttachSharePointList
acCmdImportAttachText
acCmdImportAttachXML
 

tinyevil777

Registered User.
Local time
Today, 13:28
Joined
Dec 10, 2010
Messages
137
Apologies, i know very little about vb coding. I've tried implementing "acCmdImportAttachExcel" into the onclick of a button, and i recieve a compile error, invalid use of a property.

I take it the code im using as below is incorrect?

Code:
Private Sub Command10_Click()
acCmdImportAttachExcel
End Sub
 

cyrusv

Registered User.
Local time
Today, 05:28
Joined
May 27, 2011
Messages
21
for Excel 2000, just use docmd.runcommand accmdimport.. thanks VBA!
 

Users who are viewing this thread

Top Bottom