Сообщение будет показано после одобрения модератором.
lex Пользователь Сообщений: 71 |
Доброй ночи! Нужна помощь мудрецов. |
Alt-F11 / меню Tools / References / снять флажок с Ref Edit Control |
|
lex Пользователь Сообщений: 71 |
Спасибо! Заработало! А в чем прикол этого флажка? И почему работало только на одном компе? |
lex Пользователь Сообщений: 71 |
|
seergy Пользователь Сообщений: 64 |
#5 29.07.2009 08:09:17 так и не понял чем это лечить програмно. Например, если проект защищён и переходит от одного компа к другому… |
Сообщение будет показано после одобрения модератором.
0 / 0 / 0 Регистрация: 19.01.2016 Сообщений: 2 |
|
1 |
|
27.09.2016, 18:56. Показов 41459. Ответов 5
Здравствуйте, у меня есть файл ексель с макросами, раньше все работало нормально, сейчас открываю и выдает ошибку «Microsoft Visual Basic for Applications» «Сan’t find project or library», далее нажимаю «ок» и Excell закрывается. Читал другие темы, предлагают зайти в VBA — Refences и снять галочки с библиотек MISSING, но не могу, так как не могу открыть файл Раньше на этом же компе этот файл работал без проблем Поможете? Спасибо!
0 |
Заблокирован |
|
27.09.2016, 19:23 |
2 |
Сообщение было отмечено plyacik как решение Решение Открывайте файл с нажатым [Shift]`ом.
1 |
1342 / 312 / 76 Регистрация: 13.11.2008 Сообщений: 644 |
|
27.09.2016, 21:02 |
3 |
далее нажимаю «ок» А нажать Debug или End позволяет? Если да — то жмите End. Файл должен открыться, код остановиться. И тогда уже сможете перейти в код.
1 |
0 / 0 / 0 Регистрация: 19.01.2016 Сообщений: 2 |
|
28.09.2016, 11:32 [ТС] |
4 |
В общем проблема решилась, но не очень разумным способом, нашел комп на котором открылся файл, пересохранил и все решилось. кстати с нажатим Shift’ом тоже получилось, выскочило окно на котором отключил макросы, файл пересохранил и все ок Спасибо!
0 |
0 / 0 / 0 Регистрация: 25.02.2020 Сообщений: 3 |
|
15.08.2020, 22:07 |
5 |
Случилась у меня такая же проблема, и есть там еще один обход.
0 |
0 / 0 / 0 Регистрация: 03.07.2020 Сообщений: 169 |
|
20.04.2021, 11:59 |
6 |
Franky101010, не работает решение по указанной ссылке.
0 |
So I’m having to run someone else’s excel app on my PC, and I’m getting «Can’t find Project or Library» on standard functions such as date, format, hex, mid, etc.
Some research indicates that if I prefix these functions with «VBA.» as in «VBA.Date» then it’ll work fine.
Webpages suggest it has to do with my project references on my system, whereas they must be ok on the developer’s system. I’m going to be dealing with this for some time from others, and will be distributing these applications to many others, so I need to understand what’s wrong with my excel setup that I need to fix, or what needs to be changed in the xls file so that it’ll run on a variety of systems. I’d like to avoid making everyone use «VBA.» as an explicit reference, but if there’s no ideal solution I suppose that’s what we’ll have to do.
- How do I make «VBA.» implicit in my project properties/references/etc?
-Adam
Vincent
4173 silver badges11 bronze badges
asked Feb 3, 2009 at 14:05
Adam DavisAdam Davis
91.6k59 gold badges262 silver badges330 bronze badges
5
I have seen errors on standard functions if there was a reference to a totally different library missing.
In the VBA editor launch the Compile command from the menu and then check the References dialog to see if there is anything missing and if so try to add these libraries.
In general it seems to be good practice to compile the complete VBA code and then saving the document before distribution.
answered Feb 3, 2009 at 14:24
Dirk VollmarDirk Vollmar
172k53 gold badges255 silver badges315 bronze badges
5
I had the same problem. This worked for me:
- In VB go to Tools » References
- Uncheck the library «Crystal Analysis Common Controls 1.0». Or any library.
- Just leave these 5 references:
- Visual Basic For Applications (This is the library that defines the VBA language.)
- Microsoft Excel Object Library (This defines all of the elements of Excel.)
- OLE Automation (This specifies the types for linking and embedding documents and for automation of other applications and the «plumbing» of the COM system that Excel uses to communicate with the outside world.)
- Microsoft Office (This defines things that are common to all Office programs such as Command Bars and Command Bar controls.)
- Microsoft Forms 2.0 This is required if you are using a User Form. This library defines things like the user form and the controls that you can place on a form.
- Then Save.
JimmyPena
8,6966 gold badges43 silver badges64 bronze badges
answered Jul 8, 2011 at 14:18
3
I have experienced this exact problem and found, on the users machine, one of the libraries I depended on was marked as «MISSING» in the references dialog. In that case it was some office font library that was available in my version of Office 2007, but not on the client desktop.
The error you get is a complete red herring (as pointed out by divo).
Fortunately I wasn’t using anything from the library, so I was able to remove it from the XLA references entirely. I guess, an extension of divo’ suggested best practice would be for testing to check the XLA on all the target Office versions (not a bad idea in any case).
answered Mar 4, 2009 at 22:44
RedBlueThingRedBlueThing
41.9k17 gold badges96 silver badges122 bronze badges
In my case, it was that the function was AMBIGUOUS as it was defined in the VBA library (present in my references), and also in the Microsoft Office Object Library (also present). I removed the Microsoft Office Object Library, and voila! No need to use the VBA. prefix.
answered Jul 11, 2009 at 14:14
blue_wardrobeblue_wardrobe
In my case, I could not even open «References» in the Visual Basic window. I even tried reinstalling Office 365 and that didn’t work. Finally, I tried disabling macros in the «Trust Center» settings. When I restarted Excel, I got the warning message that macros were disabled, and when I clicked on «enable» I no longer got the error message.
Later I re-enabled all macros in the «Trust Center» settings, and the error message didn’t show up!
Hey, if nothing else works for you, try the above; it worked for me!
Update:
The issue returned, and this is how I «fixed» it the second time:
I opened my workbook in Excel online (Office 365, in the browser, which doesn’t support macros anyway), saved it with a new file name (still using .xlsm file extension), and reopened in the desktop software. It worked.
answered Feb 5, 2020 at 1:09
Sean McCarthySean McCarthy
4,7508 gold badges38 silver badges55 bronze badges
2
Even when all references are fine the prefix problem causes compile errors.
What about creating a find and replace sub for all ‘built-in VBA functions’ in all modules,
like this:
replace text in code module
e.g. «= Date» will be replaced with «= VBA.Date».
e.g. » Date(» will be replaced with » VBA.Date(» .
(excluding «dim t As Date» or «mydate»)
All vba functions for find and replace are written here :
vba functions list
answered Dec 4, 2020 at 22:30
Noam BrandNoam Brand
3252 silver badges13 bronze badges
For those of you who haven’t found any of the other answers work for you.
Try this:
Close out of the file, email it to yourself or if you’re at work, paste it from the network drive to your desktop, anything to get it to open in «protected mode».
Now open the file
DON’T CLICK ANY ENABLE EDITING OR THE YELLOW RIBBON
Go to the VBA Editor
Go to Debug — — Compile VBA Project, if «Compile VBA Project» is greyed out, then you may need to click the yellow ribbon one time to enable the content, but DO NOT enable macros.
After you click Compile, save, close out of the file. Reopen it, enable everything and it should be OK. This has worked for me 100% of the time.
answered Nov 3, 2021 at 19:27
In my case I was checking work done on my office computer (with Visio installed) at home (no Visio). Even though VBA appeared to be getting hung up on simple default functions, the problem was that I had references to the Visio libraries still active.
answered Feb 5, 2018 at 10:47
SmrtGruntSmrtGrunt
85912 silver badges25 bronze badges
I found references to an AVAYA/CMS programme file? Totally random, this was in MS Access, nothing to do with AVAYA. I do have AVAYA on my PC, and others don’t, so this explains why it worked on my machine and not others — but not how Access got linked to AVAYA. Anyway — I just unchecked the reference and that seems to have fixed the problem
answered Oct 9, 2019 at 8:10
I’ve had this error on and off for around two years in a several XLSM files (which is most annoying as when it occurs there is nothing wrong with the file! — I suspect orphaned Excel processes are part of the problem)
The most efficient solution I had found has been to use Python with oletools
https://github.com/decalage2/oletools/wiki/Install
and extract the VBA code all the modules and save in a text file.
Then I simply rename the file to zip file (backup just in case!), open up this zip file and delete the xl/vbaProject.bin file. Rename back to XLSX and should be good to go.
Copy in the saved VBA code (which will need cleaning of line breaks, comments and other stuff. Will also need to add in missing libraries.
This has saved me when other methods haven’t.
YMMV.
answered Sep 21, 2020 at 7:50
Can’t find Library or Project |
||||||||
Ответить |
||||||||
Ответить |
||||||||
Ответить |
||||||||
Ответить |
||||||||
Ответить |
||||||||
Ответить |
||||||||
Ответить |
||||||||
Ответить |
||||||||
Ответить |
- Remove From My Forums
-
Question
-
Recently installed MSOffice 2010 Pro trial version and receive the following Macro error in Excel: compile error. Can’t find project or library. The Excel file was created with Office 2003 and runs okay with the Professional version of 2003,
but not the SMBS Excel 2003. I tried setting the macro security level to low in 2010, however, the macro still will not run.
Answers
-
Hi,
Most likely, the application has lost the reference to an object or type library resulting in the above error when using
Barcode Macros & Native VBA Functions.
The problem may be resolved as follows:1.
Open the database or application.
2.
Open a module in Design view or press ALT+F11 to switch to the Visual Basic Editor.
3.
On the Tools menu, click References.
4.
Clear the check box for the type library or object library marked as «Missing:»
An alternative to removing the reference is to restore the referenced file to the path specified in the References dialog box.
If the referenced file is in a new location, clear the «Missing:» reference and create a new reference to the file in its new location.
Microsoft has documented this issue:
VBA Functions Break in Database with Missing ReferencesRegards,
Harry Yuan
-
Proposed as answer by
Thursday, October 14, 2010 8:41 AM
-
Marked as answer by
sacjac
Thursday, October 14, 2010 1:10 PM
-
Proposed as answer by