Solved Need help setting up libraries in CATIAV5 VBA (1 Viewer)

goncalo

Member
Local time
Today, 12:19
Joined
May 23, 2023
Messages
51
Hello everyone,im not sure if this is the appropriate place to post this but thought i should give it a try.
Im currently trying to add the CATIA libraries to my vba editor when i open CatiaV5,however the "References" button in "Tools" section is greyed out and i cannot select it.
I've been trying to find a way to fix this issue but i've been unable to do so.

If anyone knows how to fix this please let me know!
Thanks for reading!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:19
Joined
Oct 29, 2018
Messages
21,473
References is typically greyed out while a procedure is running. Are you by any chance in Debug mode?
 

goncalo

Member
Local time
Today, 12:19
Joined
May 23, 2023
Messages
51
References is typically greyed out while a procedure is running. Are you by any chance in Debug mode?
im not sure actually
I don't think i am but even if i was i don't think i would be able to tell because like i said im very very new to catia and i've only been asked to use it to code some macros in it for other people to use
How can i tell if im in debug mode?
 

sonic8

AWF VIP
Local time
Today, 13:19
Joined
Oct 27, 2015
Messages
998
Im currently trying to add the CATIA libraries to my vba editor
I've got no experience with Catia, but I would think the core libraries of the host application are already added as references by default. - But, I understand, if you cannot open the references dialog, you cannot check for this via the user interface.

How can i tell if im in debug mode?
In main VBA tool bar there is a set of three buttons: Play, Pause, Stop. These allow you to run, pause, and stop code execution. If the Play button is disabled, the code is currently running.

Which vba application are you in?
The OP said so very explicitly: Catia V5
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:19
Joined
Feb 19, 2013
Messages
16,613
The OP said so very explicitly: Catia V5
agree the OP said 'when i open CatiaV5'

but also said 'trying to add the CATIA libraries'

So just trying to clarify.

I'm not familiar with CatiaV5 (although I'm aware of it existence, I use other Dassault products).
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:19
Joined
Jul 9, 2003
Messages
16,282
ChatGPT said:-

Unlock CATIA VBA Libraries​

If the "References" button in the VBA editor is greyed out when you open CATIA V5, it indicates that the VBA project is protected or locked. By default, CATIA V5 protects its VBA projects to ensure the integrity and security of its functionalities. To enable the "References" button and add CATIA libraries to your VBA project, you'll need to follow these steps:
  1. Open CATIA V5 and access the VBA editor: Go to "Tools" > "Macro" > "Visual Basic Editor" or simply use the shortcut key Alt+F11.
  2. In the VBA editor, check if the "Project Explorer" is visible (if not, you can enable it by pressing Ctrl+R).
  3. Locate your VBA project: It should be listed under "VBAProject (Your_Part_Name)" or similar.
  4. Right-click on the VBA project and select "Properties" from the context menu.
  5. In the "Project Properties" window, uncheck the "Lock project for viewing" option.
  6. If prompted, you may need to provide the VBA project password. If you don't have one, just leave it empty and click OK.
  7. Close and reopen the VBA editor to apply the changes.
After performing these steps, the "References" button should no longer be greyed out, and you should be able to add the CATIA libraries to your VBA project.
 

goncalo

Member
Local time
Today, 12:19
Joined
May 23, 2023
Messages
51
ChatGPT said:-

Unlock CATIA VBA Libraries​

If the "References" button in the VBA editor is greyed out when you open CATIA V5, it indicates that the VBA project is protected or locked. By default, CATIA V5 protects its VBA projects to ensure the integrity and security of its functionalities. To enable the "References" button and add CATIA libraries to your VBA project, you'll need to follow these steps:
  1. Open CATIA V5 and access the VBA editor: Go to "Tools" > "Macro" > "Visual Basic Editor" or simply use the shortcut key Alt+F11.
  2. In the VBA editor, check if the "Project Explorer" is visible (if not, you can enable it by pressing Ctrl+R).
  3. Locate your VBA project: It should be listed under "VBAProject (Your_Part_Name)" or similar.
  4. Right-click on the VBA project and select "Properties" from the context menu.
  5. In the "Project Properties" window, uncheck the "Lock project for viewing" option.
  6. If prompted, you may need to provide the VBA project password. If you don't have one, just leave it empty and click OK.
  7. Close and reopen the VBA editor to apply the changes.
After performing these steps, the "References" button should no longer be greyed out, and you should be able to add the CATIA libraries to your VBA project.
I tried doing this and yet the References button is still greyed out...
Could it be that the CATIA license that the company i work for uses is blocking the workers from adding libraries to CATIA?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:19
Joined
Jul 9, 2003
Messages
16,282
I think it's time for you to ask Chat GPT!
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:19
Joined
Jul 9, 2003
Messages
16,282
This is the chat GPT thread I used to get the answer shown above. You can probably continue interrogating Chat GPT? Not sure, this is new to me!

Link deleted by UG
 

goncalo

Member
Local time
Today, 12:19
Joined
May 23, 2023
Messages
51
well i guess i got it working
the lock for project viewing was NOT selected,i selected it and put a password,deselected it and it then worked!
Thanks Uncle Gizmo!
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:19
Joined
Jul 9, 2003
Messages
16,282
I'm going to delete that chat GPT link. I'm not sure how it would affect my chat GPT account and my security!
 

Users who are viewing this thread

Top Bottom