Skip to Content
0

VBA invalid member

Sep 18, 2017 at 04:51 PM

36

avatar image
Former Member

Hi guys,

I developped the following code in VBA for a EPM report:

If Range("ID_INTERNAL") <> "" And Range("FORM_TYPE").Value = "P_FORM_TYPE_PART" Then
        If epm.GetPropertyValue(CxACTV, Range("PART_ID_L"), "PART_SHARE") <> Range("PART_SHARE_L") Or _
            epm.GetPropertyValue(CxACTV, Range("PART_ID_1"), "PART_SHARE") <> Range("PART_SHARE_1") Or _
            epm.GetPropertyValue(CxACTV, Range("PART_ID_2"), "PART_SHARE") <> Range("PART_SHARE_2") Then
                MsgBox "Consolidation Required"
end if


The problem is that sometimes : PART_ID_L and PART_ID_1 and PART_ID_2 can be empty, and they generate an error : Invalid member

How can i correct this problem?

Thanks.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Vadim Kalinin Sep 18, 2017 at 06:13 PM
1

"How can i correct this problem?" - sorry, but you are not explaining what do you want to have if "PART_ID_L and PART_ID_1 and PART_ID_2 can be empty"...

You can always test:

If Range("PART_ID_L")="" Then...

What is the issue????

Show 8 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Vadim,

I just want to do my test anyway. And avoid te invalid member error.

Thanks

0

I have already answered your question! Do you understand the answer?

0
Former Member

Hi Vadim,

Thanks for your answer.

I mean is there any EPM function that i can use in my context?

Thanks.

Amine

0

You don't need any EPM function, you need some VBA training!

Before executing function:

epm.GetPropertyValue(...

You have to check that parameters are not empty:

If Range("PART_ID_L") = "" OR Range("PART_ID_1") = "" OR Range("PART_ID_2") = "" Then...

You can also use IIF to perform inline check!

0
Former Member

Ok thank you Vadim.

0

Then cloase the question accepting the correct answer

0

The answer is not accepted!

0
Former Member

Done!

Thanks Vadim.

0