changing the transition effect property in macro

nilmol

New Member
Joined
Jun 12, 2017
Messages
11
Hi,

Is it possible to change the transition effect property in a macro?

What I want to do is to change between CoverRight and CoverLeft depending on if the previous tab is left or right from the selected tab.

I use the mouse down event to register the present tab and the mouse up event to register the new selected tab. This works well. But when trying to set the transition effect accordingly all fails with error message 438, method not supported.

What I've tried so far without success is;
FnrDep is the value of the previous tab.
In the MouseUp Event I put:

FnrArr = Mpg_Planering.Value
If FnrArr < FnrDep Then
Mpg_Planering.Page(FnrArr).TransitionEffect = 3
Else
Mpg_Planering.Page(FnrArr).TransitionEffect = 7
End If


Am I hoping to much from Excel or am I doing something wrong?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
It's Pages(FnrArr) rather than Page(FnrArr)
 
Upvote 0
Thanks!

However, it seems that it doesn't always work as expected. Sometimes, not always, the transition effect is the opposite than expected. Maybe it will work better if I use the Change event instead of mouseUp. Trial and error...
 
Upvote 0
Ok, I've figured it out...

Since transition happens before it's possible to set the transition effect to the tab that was clicked it's necessary to set the wanted transition effect to all tabs depending on which tab was clicked. Not sure if I'm being clear abut this but this code does the work that I wanted, i.e sliding left if a tab left of of previous tab was clicked and viceversa.

In the MouseUp Event:
Code:
Select Case Mpg_Planering.Value
    Case 0
            Mpg_Planering.Pages(1).TransitionEffect = 7
            Mpg_Planering.Pages(2).TransitionEffect = 7
            Mpg_Planering.Pages(3).TransitionEffect = 7
    Case 1
            Mpg_Planering.Pages(0).TransitionEffect = 3
            Mpg_Planering.Pages(2).TransitionEffect = 7
            Mpg_Planering.Pages(3).TransitionEffect = 7
    Case 2
            Mpg_Planering.Pages(0).TransitionEffect = 3
            Mpg_Planering.Pages(1).TransitionEffect = 3
            Mpg_Planering.Pages(3).TransitionEffect = 7
    Case 3
            Mpg_Planering.Pages(0).TransitionEffect = 3
            Mpg_Planering.Pages(1).TransitionEffect = 3
            Mpg_Planering.Pages(2).TransitionEffect = 3
End Select
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,310
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top