LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Error: can't find project or library

Hi-
We are trying to put out a small investment system in Excel to many users.
When I run the following macro with Excel 2000 it runs fine, but when I run
it with Excel v. 2003, I get the error: Can't find project or library. I
will mark below where the error occurs. As a follow up question, will we
need to send out different macros to users depending on their version of
Excel? You guys always come through for me. Thanks in advance!

Sub PlanCa()
'Modified BevUpdate2 because it assumes
'user's filename is "UserFile.xls"
'Will also attempt to make a variable for user's file

Dim updfile As String
' Dim usrfile As String
' Dim n, p
' n = ActiveWorkbook.Name
' p = ActiveWorkbook.Path
updfile = ActiveWorkbook.Path
updfile = updfile & "\" & "devfile.xls"
' updfile = p & "\" & "devfile.xls"
' usrfile = p & "\" & n
Set usrfile = ActiveWorkbook 'HERE IS WHERE ERROR OCCURS!!!!!!!!!!
' Set updfile = updfile 'Tried to make it an object
'ERROR: REQUIRES OBJECT

'Make backup of user's file
usrfile.SaveCopyAs filename:="fxRiskMasterBackup.xls"
'Prefer "Backup" append to User's own filename,
'and save in current folder.

'Insert Filename in Filename cell
Range("Filename") = ActiveWorkbook.Name

'Copy Filename to Update file: UserFilename cell
Sheets("Lookup").Visible = True
Application.Goto Reference:="Filename"
Selection.Copy
'Workbooks.Open Filename:=updfile 'OPEN devFile
If Dir(updfile) = "" Then
MsgBox ("Devfile.xls not found. Move devfile.xls to this folder.")
Exit Sub
End If
' On Error Resume Next
' Test to see if the file is open.

If IsFileOpen(updfile) Then
' Display a message stating the file in use.
'MsgBox "File already in use!"

Else
' Display a message stating the file is not in use.
' MsgBox "File not open!"
' Open the file in Microsoft Excel.

Workbooks.Open filename:=updfile 'OPEN devFile

End If


'Workbooks.Open Filename:=updfile 'OPEN devFile
'Copy Filename to Update file: UserFilename cell
usrfile.Activate
Sheets("Lookup").Visible = True
Application.Goto Reference:="Filename"
Selection.Copy
Windows("devFile.xls").Activate
Sheets("Lookup").Visible = True
Application.Goto Reference:="userfilename"
ActiveSheet.Paste

'Copy Current Version to Update file, Old Version cell
usrfile.Activate 'WORKS!
Application.Goto Reference:="CurrentVersion"
Application.CutCopyMode = False
Selection.Copy

'Activate devFile. Can't make this happen with variable
' updfile.Activate 'ERROR: INVALID QUALIFIER
' Windows(updfile).Activate 'ERROR: SUBSCRIPT OUT OF RANGE
Windows("devFile.xls").Activate
Application.Goto Reference:="OldVersion"
ActiveSheet.Paste

'Activate Update2 macro
' Application.Run "'devFile.xls'!Update3"
' Application.Run "!Update3"
' Application.Run "'updfile'!Update3"
' Application.Run "'ActiveWorkbook'!Update2"
Application.Run "'devfile.xls'!Update2"

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Find Project or Library Error Vick Excel Discussion (Misc queries) 1 May 17th 08 12:25 PM
can't find project or library - error Chris T-M New Users to Excel 4 January 18th 07 10:23 PM
error can't find project or library cedtech23[_19_] Excel Programming 1 July 21st 06 06:48 PM
Error:Can't find project or library Casey[_19_] Excel Programming 9 August 13th 05 09:53 AM
Comple Error Cannot Find Project or Library ExcelMonkey[_190_] Excel Programming 13 March 22nd 05 06:24 PM


All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"