Consulting

Results 1 to 3 of 3

Thread: How to add reference to external library?

  1. #1
    VBAX Newbie
    Joined
    Feb 2019
    Posts
    2
    Location

    How to add reference to external library?

    Hello everyone,
    I am a circuit designer using Cadence OrCAD Capture as tool, I am now trying to code a VBA script to automatically assign pins and nets according to a Excel file.
    The script is set to be running in OrCAD but not Excel.
    The intrinsic VBA compiler of OrCAD does not have a reference configurator and the reference must be added via codes.
    "ThisWorkbook.VBProject.References." does not work in OrCAD Capture, I need some other method to cover this need.

    The screenshot below is the result of running without reading XLS file:
    AutoWire.PNG

    SUB TestMacro
      'MACROMENU Set TestMacro Properties
      'MACROKEY C
      'MACRODESCRIPTION ****
    
    
    path=InputBox("You are ****ed.","****ed path","E:\XM_EE.olb")
    part=InputBox("You are ****ed.","****ed part","J_ASE6H4010")
    desi=InputBox("You are ****ed.","****ed designator","")
    PlacePart 0, 0, path, part, desi, FALSE
    
    
    PlaceWire -0.3, 0.3, -0.8, 0.3
    PlaceNetAlias 0, 0, "GPIO_****ed"
    
    
    For i=0 To 10 Step 1
        PlaceWire 0.5, 0.1, 0, 0.1
        PlaceNetAlias 0, 0, "GPIO_****ed"
    Next
    
    
    END SUB
    If anyone can solve my problem, I would be very appreciate, Thx!

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Have you tried using late binding with GetObject/CreateObject?
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Newbie
    Joined
    Feb 2019
    Posts
    2
    Location
    Ahhh! Thx for enlighting me!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •