cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Using VB API with Excel

AndreasHellmann
3-Visitor

Using VB API with Excel

Hello,

I am developing some test applications with the VB API in Wildfire 4 (M070).

A lot of things are working as expected. Like in Toolkit and Weblink I am familiar with.

Now I have some problems with some subroutines in Excel VBA. Is there anybody out there who had similiar problems; I think I am making some basic mistakes?
Some of the functions work in VB .NET applications, but not in VBA with Excel. I tried Excel 2003 and 2007. The problems are the same.

An example:

I want to set a config.pro option.
Having the handle to the session, it should be no problem to call the method SetConfigOption (sName, sValue).

The VBA editor in Excel colors the row in red. Other methods like ChangeDirectory(sPath) work fine.

In the example application try2setconfigopt.xls the line
hSession1.SetConfigOption ("display_points", "yes")
is highlighted in red...

I have the same problem when trying to set up an identity matrix for component placement.

The row
hMatrix.Set (i, j, 1.0)
is displayed in red and will throw an error if I try to run the application anyway.

I attached 2 applications to this thread.

Thanks for having a look to this.

Andreas

Andreas

__________________________________

Andreas Hellmann
MCAD Services Pro/E & Pro/E customization

phone: +49 6145 598296
mail: -

3 REPLIES 3

Hi,

 

I have done some vba Excel with Creo for the past year or so, and I could get most of my functions working (often with a lot of trial and error), but these particular 2 functions are in my top 3 of not-working-stuff!!

Anyone who got create matrix and setconfigoption working in excel vba?? I did get stuff working in JLink, but excel is a more convenient tool for casual CAD users, and JLink is quite a pain when trying to create a button in Creo...

You would make at least 2 people happy!

Thnx,

Jaap

jkramer
9-Granite
(To:jkramer)

Hello,

 

just curious about this command:

hMatrix.Set (i, j, 1.0)

Does anyone have a clue how to make this work in Excel VBA??

I still haven't found a way out, and I have a new situation requiring the creation of a Transformation Matrix.

In 2018 the other question of Andreas (and me) was answered, but this question remained unanswered, i think...

Thanks!

Jaap

 

Hi Andreas,

Remove the parenthesis 

hSession1.SetConfigOption "display_points", "yes"

 

 

Thanks & Regards,

Vinod

Top Tags