×
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

Insert and link part of excel sheet to CATIA V5 drawing

Insert and link part of excel sheet to CATIA V5 drawing

Insert and link part of excel sheet to CATIA V5 drawing

(OP)
Hi,

I am attempting to copy, paste and part of an excel sheet to a drawing sheet in CATIA V5 using a code in VBA excel. I have minimal experience programming but I know this would be more efficient than the current method used. This is what I have so far:

------------------------------------------------------------------------------------------------------------
Sub CATMain()

' CopyingaTable Macro

' Used to copy a table and insert to CATIA

' obtain the Catia Object

Dim CATIA As INFITF.Application
On Error Resume Next
Set CATIA = GetObject(, "CATIA.Application")
If Err.Number <> 0 Then
Set CATIA = CreateObject("CATIA.Application")
CATIA.Visible = True
End If
On Error GoTo 0

'active worksheet
Dim oWB As Excel.Workbook
Set oWB = Excel.ActiveWorkbook
Dim oSh As Excel.Worksheet
Set oSh = oWB.ActiveSheet

'Copying part of a worksheet

Dim rng As Range
Set rng = Application.InputBox("Select a range", "Obtain Range Object", Type:=8)

MsgBox "The cells selected were " & rng.Address

Range(rng.Address).Select
Selection.Copy

'opening a new drawing

Dim File As String
Dim ADoc As Document
File = CATIA.FileSelectionBox("File Open", ".CATDrawing", CatFileSelectionModeOpen)
If File <> "" Then Set ADoc = CATIA.Documents.Open(File)

'Creating a drawing table
Dim Insert As Action

End Sub
-----------------------------------------------------------------------------------------------------

Thanks for any help,
Jordan

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