Compile Error: "Cant find project on Library" in MS 2003 but works fine in 2007 (1 Viewer)

Summer123

Registered User.
Local time
Today, 11:07
Joined
Feb 9, 2011
Messages
216
Compile Error: "Cant find project on Library" in MS 2003 but works fine in 2007

Hello everyone,
can someone please help me in determining this issue? I have the following piece of code that is erroring in MS 2003 but it works fine in 2007.
it highlights the "Set ref =" under the form_open and gives that error in 2003. Again it works fine 2007 so i am not sure what is going on. Can someone please assist?

Code:
Private Sub Form_Open(Cancel As Integer)
'Maximize Access
    DoCmd.RunCommand acCmdAppMaximize
'Resize form
    DoCmd.Restore
    
'Set references
    On Error Resume Next
    Set ref = References.AddFromFile("C:\WINDOWS\system32\comdlg32.ocx")
    Set ref = References.AddFromFile("C:\Program Files\Microsoft Office 2000\Office\MSO9.DLL")
    Set ref = References.AddFromFile("C:\Progra~1\Common~1\Microsoft Shared\VBA\VBEEXT1.OLB")
    Set ref = References.AddFromFile("c:\WINDOWS\SYSTEM32\DAO360.DLL")
    Set ref = References.AddFromFile("C:\Program Files\Microsoft Office\Office\MSACC8.OLB")
    Set ref = References.AddFromFile("C:\PROGRA~1\COMMON~1\Microsoft Shared\VBA\VBA332.DLL")
    Set ref = References.AddFromFile("C:\WINDOWS\SYSTEM32\MSSTDFMT.DLL")
    On Error GoTo 0

End Sub
 

Trevor G

Registered User.
Local time
Today, 16:07
Joined
Oct 1, 2009
Messages
2,341
Re: Compile Error: "Cant find project on Library" in MS 2003 but works fine in 2007

I think you have a clash with numbers !

Office 97 is version 8
Office 2000 is version 9
Office 2002 is verison 10
Office 2003 is version 11
Office 2007 is version 12
Office 2010 is version 13

so your msaccess maybe wrong

On Error Resume Next
Set ref = References.AddFromFile("C:\WINDOWS\system32\comdlg32.ocx")
Set ref = References.AddFromFile("C:\Program Files\Microsoft Office 2000\Office\MSO9.DLL")
Set ref = References.AddFromFile("C:\Progra~1\Common~1\Microsoft Shared\VBA\VBEEXT1.OLB")
Set ref = References.AddFromFile("c:\WINDOWS\SYSTEM32\DAO360.DLL")
Set ref = References.AddFromFile("C:\Program Files\Microsoft Office\Office\MSACC8.OLB")
Set ref = References.AddFromFile("C:\PROGRA~1\COMMON~1\Microsoft Shared\VBA\VBA332.DLL")
Set ref = References.AddFromFile("C:\WINDOWS\SYSTEM32\MSSTDFMT.DLL")
On Error GoTo 0
 

Summer123

Registered User.
Local time
Today, 11:07
Joined
Feb 9, 2011
Messages
216
Re: Compile Error: "Cant find project on Library" in MS 2003 but works fine in 2007

hey sorry to take awhile to get back to you, i did what you suggested but the issue was there was some refrences that had "Missing" in front of them and when i removed those it went through without issues but then when i try to browse for my file its now giving another error here is where its bombing now

"runtime error - 438"
Object doesnt support this property or method

'Get file selection from common dialog control
With Me.ComDialogBTN
.DialogTitle = "Select File" ' this is where its highlighting, if i comment this out then it goes to the next line.. does this have anything to do with ActiveX controls or something???
.CancelError = False
.Filter = "All files (*.*)|*.*|"
.FilterIndex = 1
.Flags = MSComDlg.FileOpenConstants.cdlOFNFileMustExist _
Or MSComDlg.FileOpenConstants.cdlOFNPathMustExist _
Or MSComDlg.FileOpenConstants.cdlOFNReadOnly
.InitDir = fnPath("files")
.FileName = ""
.ShowOpen
If .FileName = "" Then Exit Sub
End With
 

Summer123

Registered User.
Local time
Today, 11:07
Joined
Feb 9, 2011
Messages
216
Re: Compile Error: "Cant find project on Library" in MS 2003 but works fine in 2007

help please anyone
 

Summer123

Registered User.
Local time
Today, 11:07
Joined
Feb 9, 2011
Messages
216
Re: Compile Error: "Cant find project on Library" in MS 2003 but works fine in 2007

ok i'm still getting this error and i've tried many things.. anyone have any idea? am i missing any refrences or something?
 

M_B

New member
Local time
Tomorrow, 01:07
Joined
Mar 13, 2012
Messages
1
Re: Compile Error: "Cant find project on Library" in MS 2003 but works fine in 2007

Try to register the file MSCOMCTL.OCX; that worked here.

regsvr32.exe MSCOMCTL.OCX

Good luck.
 

Users who are viewing this thread

Top Bottom