Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

CATIA VBA error (fresh install)

Status
Not open for further replies.

mrawlinc

Industrial
Nov 19, 2012
36
It might be a common problem, couldn't find solution. So, as fresh install was needed (B25), now I can't get to run even a simple code like this:

Code:
Sub CATMain()

    Dim RootProduct As Product
    Set RootProduct = CATIA.ActiveDocument.Product
    
    MsgBox RootProduct.Name
    
End Sub

I'm receiving an error (Can't find project or library) right in the first line "Dim RootProduct As Product"
Where there any changes from VB6.x to 7.1? Previously I was working on VB6.
 
Replies continue below

Recommended for you

I tried with this (under admin)
C:\Program Files\Dassault Systemes\B##\Win_b64\Code\bin\CNEXT.exe /unregserver
and
C:\Program Files\Dassault Systemes\B25\Win_b64\Code\bin\CNEXT.exe /regserver

but still macros doesn't work... also there was no previous version of catia on this computer it's system (win10) fresh install
 
From DS Knowledge Base.

Automation usage on multiple level on the same machine can not be done in parallel but only consecutively and with unregistering the first version before registering the new one to switch fron Rn to Rn+x

In the V5Rn installation directory, in a command prompt window, type :
catstart -run V5RegServer -unset

In the V5Rn+x installation directory, in a command prompt window, type :
catstart -run V5RegServer -set ProductLine env MyV5Environment DirEnv MyV5EnvDirectory

Regards
Fernando

- Romania
- EU
 
I have had some old .catvba files containing macros (from B19) and those didn't work in B25 straight away, what I did now is create new .catvba, create and copy/pase codes to newly created macros and it works ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor