Thursday, November 21, 2013

Using a file dialog box in Access 2010

When installing a "Microsoft Common Dialog Control 6.0" in an Access 2010 form, I receive the error "You don't have the license required to use this ActiveX control".

Apparently the ActiveX controls have a lot of new limitations for security reasons in Access 2010.

To work around this, I dimenioned the control directly in the code as follows:


Dim f As FileDialog
Set f = Application.FileDialog(msoFileDialogFilePicker)
f.Show
MsgBox "file choose was " & f.SelectedItems(1)

When doing this, make sure to add "Microsoft Office 14.0 Object Library" to the references.

No comments:

Post a Comment

VBA Excel to Double Click change to checkmark or x

 Note that to do this, you need to set the font of the affected cells to Winding 2 first: 1 2 3 4 5 6 7 8 9 10 11 12 Private Sub Worksheet...