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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Gettext method in listbox

Raiko
16-Pearl

Gettext method in listbox

Hello Folks,

I have this annoying problem in a listbox. I'd like to read in data from an excel sheet. For this I have found a nice routine (thanks again for that) in this forum that provides me all files of a given directory which I then can choose from a listbox. Works like a charm!

Now I'd like to select via a similar mechanism a certain sheet in this Excel file. The problem now is that I can't extract the text of this selected element via the GETTEXT method; MathCad claiming it to be an invalid operation. This method however, works fine with a simple Listbox.

Hope somebodya can find a solution for that (see attached sheet)

Thanks in advance

Raiko

1 ACCEPTED SOLUTION

Accepted Solutions

Hello Andy,

thanks for the reply. Unfortunately this doesn't do the job I'd like to see. My code accesses the files in a directory just as your one does (your's faster!) but I cvan't get it running when I'm trying to access the data of a specific worksheet in a chosen excel file.

Cheers

Raiko

View solution in original post

7 REPLIES 7
AndyWesterman
4-Participant
(To:Raiko)

Hi Raiko,

Not sure why the list box.gettext method doesn't work (it is listed in the help files)

Attached is a very old sheet from the old collab forum.

Should do all you want (I hope)

Regards

Andy

Hello Andy,

thanks for the reply. Unfortunately this doesn't do the job I'd like to see. My code accesses the files in a directory just as your one does (your's faster!) but I cvan't get it running when I'm trying to access the data of a specific worksheet in a chosen excel file.

Cheers

Raiko

AndyWesterman
4-Participant
(To:Raiko)

Hi Raiko,

Attached seems to work for me - only change was to add back the default Addstrings calls for 'one' 'two' & 'three'.

Perhaps the get textcall crashes if there is a NULL list.

I've looked at the Excel & other data import wizards & haven't seen any way to include a variable name into the field.

I have tried to do that for a couple of applications but at the moment I have it hard coded into a reference mathcad sheet,

I would be grateful to know if you succeed.

Regards

Andy

Hello Andy,

thanks for the reply. Unfortunately this doesn't do the job I'd like to see. My code accesses the files in a directory just as your one does (your's faster!) but I cvan't get it running when I'm trying to access the data of a specific worksheet in a chosen excel file.

Cheers

Raiko

Hello Andy,

thanks for the reply. Unfortunately this doesn't do the job I'd like to see. My code accesses the files in a directory just as your one does (your's faster!) but I cvan't get it running when I'm trying to access the data of a specific worksheet in a chosen excel file.

Cheers

Raiko

Hello Andy,

thanks for the reply. Unfortunately this doesn't do the job I'd like to see. My code accesses the files in a directory just as your one does (your's faster!) but I cvan't get it running when I'm trying to access the data of a specific worksheet in a chosen excel file.

Cheers

Raiko

Hello Andy,

it works now. I'm not sure either why it is running right now but I'll worry about that some other time

Many thanks to all whoe helped

Raiko

Top Tags