×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CATIA VBA error (fresh install)

CATIA VBA error (fresh install)

CATIA VBA error (fresh install)

(OP)
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.

RE: CATIA VBA error (fresh install)

(OP)
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

RE: CATIA VBA error (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

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

RE: CATIA VBA error (fresh install)

(OP)
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 ...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources