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 V5R17 doesn't write apropriate design table on xls 2

Status
Not open for further replies.

frztrb

Mechanical
Sep 29, 2010
151
IT
Hi All

I am trying to create some parameters and write them on an excell file , CATIA creates the xls file , but excell can not read it , mentions it's another format , but when I open it , the file is empty , what's the problem ? office is 2010 btw

thank you very much
 
Replies continue below

Recommended for you

thank you Ferdo

Just wanted to know , that the first excell file that you uploaded , you have written the macros independently from CATIA ? the file that has modifying buttons
 
I am still searching for an apropriate tutorial something , where should I start ?

I want to know also , if it's possible to write the Macro in excell that can save the edited file in CATIA as a step format
 

I have encountered a very simple problem , I have opened a Macro runtime window , and put this line in it

Language ="VBScript"

Sub CATMain()

Dim Document0 As Document

and I get an error of expected end of statement

while it is exactly as it's written in the help and everywhere

what is the problem ?
 
Each "Sub" needs an "End Sub"
Example:
Code:
Language="VBSCRIPT"

Sub CATMain()

Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim product1 As CATBaseDispatch
Set product1 = partDocument1.GetItem("PART1") 'the Part Number of the part is "PART1"

product1.DescriptionRef = "TEST DESCRIPTION 2"

End Sub
 
well my code also had the end sub , I just did not put it here , cause the code running stops in this line , but when I ran it as catscript it worked.

@Fernando : on the prism code there is the same problem , but also a bit more , that when I run it as VBscript the expected end of statement appears , and when I run it as CATScript , the line activedocument is not accepted as a right argument , so I don't know which is which and how to correct it
 
Those are CATScript not catvbs, I told you what you have to do if you want to run it as catvbs. You need to Google a little bit to see differences between them (and generally speaking differences between different other languages which seems to be similar).

Macro prism will run correctly if you open first an empty part, if your active document is nothing or something else then CATPart, macro will give you that error.

Regards
Fernando

 
@Fernando : I honestly have searched , not a bit , but a lot , finally I have got some sources , I am reading them , I did according to your advice , the error moved to the line 21 of Prism !! another one ( the method failed ...)

even I get the "expected end of statement " error for this simple script when also I open the part :

Sub CATMain()

Dim strHello As String

strHello="Hello"

MsgBox strHello

End Sub


sorry for many questions , but I am studying the books but in CATIA can't take even the first step
 
I even tried the codes with regarding to the condition , opening a part body , but it still doesnt work properly , same errors , anyone could help me ?
 
Maybe you could try using the macro recorder to record the same procedure in both languages.
Then compare the code.

Personally, I prefer VB.NET.
Its easy to work with and much more powerful that a scripting language.
But, I see this thread is deviating well far away from where it started; so, I'll leave it at that.
 
garzar is right. You should start another thread but all what you told us in lasts posts are really basic programming stuff. Probably a basic programming training will clarify you all these elementary things.

No one can help you if you don't provide pictures or tell what are you using very clear -vba in CATIA or Excel, CATSCript, catvbs or what ever....

For example, your last code is working fine for me in CATScript, CATIA v5r21, doesn't mater if I have something opened or not in CATIA.

Regards
Fernando

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top