Ask Your Question
0

[Calc Macro] Case-Sensitive InStr not working

asked 2016-06-13 17:46:30 +0200

Stephanium Lupis gravatar image

updated 2016-06-13 17:47:15 +0200

InStr call like

msgbox InStr(0,"subSTRing","str",0)

or

msgbox InStr("subSTRing","str",0)

when run shows error message "Action not supported. Invalid procedure call." Is it a bug? According to this page https://help.libreoffice.org/Basic/In... first call should work.

Version: 5.1.3.2
Build ID: 1:5.1.3-0ubuntu1
CPU Threads: 2; OS Version: Linux 4.4; UI Render: default; 
Locale: en-US (en_US.UTF-8)
edit retag flag offensive close merge delete

Comments

Maybe you mean msgbox InStr(1,"subSTRing","str",1) and msgbox InStr("subSTRing","str")?

JohnSUN gravatar imageJohnSUN ( 2016-06-13 19:51:46 +0200 )edit

Both of your statements are equal and return 4. At least on my machine.

Stephanium Lupis gravatar imageStephanium Lupis ( 2016-06-13 19:58:47 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-06-13 19:13:17 +0200

pierre-yves samyn gravatar image

HI

msgbox InStr(1, "NotACollection","Coll")

Gives 5: you inspect a string, not a collection, so start is not 0 but 1

Regards

edit flag offensive delete link more

Comments

Thank you for help!

Stephanium Lupis gravatar imageStephanium Lupis ( 2016-06-13 19:50:51 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-06-13 17:46:30 +0200

Seen: 181 times

Last updated: Jun 13 '16