Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Library problem - DB made on 2003, one item fails w/ 2000

Status
Not open for further replies.
Mar 29, 2006
24
US
Hey all,

Hopefully this hasn't been answered already, I wasn't able to find anything by searching.

I have the following code in order to have a user be able to select a file for importing into the database.

----------
Public Function GetFile()
GetFileWorked = 0
Dim fDialog As Office.FileDialog

Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = False
.Title = "Please select the file to import."
.Filters.Clear
.Filters.Add "Microsoft Excel File", "*.xls"
If .Show = True Then
For Each varFile In .SelectedItems
Dim ReversedString As String, FirstFind As Integer
ReversedString = StrReverse(varFile)
FirstFind = InStr(ReversedString, "\") - 1
FileName = StrReverse(Mid(ReversedString, 1, FirstFind))
Next
GetFileWorked = 1
Else
MsgBox ("You either hit Cancel or did not select a file. Please try again.")
GetFileWorked = 0
End If
End With
End Function

-----------

Now, I have the Office 11 object library available in my references, so that worked fine while I was making the DB, and it tested fine on my computer and my co-worker's computer.

Unfortunately, when a different co-worker attempted to use the import function, it failed saying that it was using an invalid reference. I assume this is because he is using Access 2000, and only has the Office 9 object library.

Is there any way to either make the Office 11 object library available to Access 2000 (I already tried copying the file and selecting "browse" under the Tools->References in the VB editor window). Failing that, how can I make this code compatible with both versions?

Thanks all!
 
Ewww, that looks gross. :)

I'll give it a shot, but perhaps I'll just encourage him to call the helpdesk and upgrade his computer's software version. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top