Im writing vba for Excel#2010 on windows but some of the user are on mac. their
ID: 3561054 • Letter: I
Question
Im writing vba for Excel#2010 on windows but some of the user are on mac.
their version is Excel for Mac#2011.
i would like to move vertical pagebreak to right.
The original pagebreak is on between J and K columns.
(after "ActiveSheet.ResetAllPageBreaks" code)
i want to move the break to beteween P and Q columns. those code below give me errors
ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, RegionIndex:=1
Error:1004 (seems vba on Mac does not recognize "RegionIdex" )
Set ActiveSheet.VPageBreaks(1).Location = Range("Q1")
Error:1004
i have tried many way to adjust the pagebreaks to get intended print area but in vain.
but on windows its so simple to move the original vertical pagebreak to the position.
please help me to move this on mac as well
thanks and regards.
Explanation / Answer
I can reproduce the problem with both code examples you provided.
Excel 2011 does not have RegionIndex in its object model when checked by the object browser. I think it is supposed to have RegionIndex and that it is a bug that the object is missing.
Your syntaxx for VPageBreaks is correct. Even the Excel macro recorder agrees. But the code does not execute. Again, I think this is a bug.
You should send feedback to Microsoft. Send two messages - one for each problem because bugs are tracked separately. In each report describe the problem as you have done here, but also include the reasons why fixing this functionality is important to you. Especially, how many end users are affected by each bug.
To send i a report, display the suggestion form by going to the Excel Help menu and choosing Send Feedback. Fill in the form and your message will get to Microssoft.