cancel
Showing results for 
Search instead for 
Did you mean: 

VBA invalid member

amine_lamkaissi
Active Contributor
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor

"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????

amine_lamkaissi
Active Contributor
0 Kudos

Hi Vadim,

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

Thanks

former_member186338
Active Contributor
0 Kudos

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

amine_lamkaissi
Active Contributor
0 Kudos

Hi Vadim,

Thanks for your answer.

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

Thanks.

Amine

former_member186338
Active Contributor
0 Kudos

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!

amine_lamkaissi
Active Contributor
0 Kudos

Ok thank you Vadim.

former_member186338
Active Contributor
0 Kudos

Then cloase the question accepting the correct answer

former_member186338
Active Contributor
0 Kudos

The answer is not accepted!

amine_lamkaissi
Active Contributor
0 Kudos

Done!

Thanks Vadim.

Answers (0)