0

I have a macro that has worked before in powerpoint 2016. But after some time it did not work. I want to use the macro to rotate a picture by 0.1 degrees. (Normally you can only rotate by 1.0 degree.) This is the code of the macro which I found here:

Sub littleRot()
    Dim oshp As Shape
    On Error Resume Next
    Set oshp = ActiveWindow.Selection.ShapeRange(1)
    oshp.Rotation = oshp.Rotation + 0.1
End Sub 

I did ‘Run’ the macro. I select the picture Format - (menu Arrange:) Rotate – More Rotation Options I tried ‘0.1’ and ‘0,1’. But it automatically rounds to an integer.

Because it has worked before I think the macro is not enabled. I can’t think of anything else that changed since the previous time it worked. So I tried in Trust Center Macro Settings ‘Enable all macros’. I also digitally signed the macro.

I did not have an error message.

  • Your macro is running fine on my machine and that in 0.1 increments – Sam May 13 '18 at 20:36
  • Add `Debug.Print oshp.Rotation` before and after `oshp.Rotation = ...` and observe in Immediate Window to see if your macro has executed. What if there are no Shapes in that current Selection? – PatricK May 13 '18 at 23:18
  • That worked! With CTRL G the Immediate Window opened. In 2 windows (powerpoint and visual basic) I see the precise rotation. https://stackoverflow.com/questions/2916287/where-does-vba-debug-print-log-to – Peter van Tilburg May 14 '18 at 18:42

1 Answers1

0

The problem is that you're looking for the amount of rotation in the same dialog box that's unable to display anything but integers.

After running your macro, run this:

Sub WhatUtterRot()
    Dim oshp As Shape
    Set oshp = ActiveWindow.Selection.ShapeRange(1)
    MsgBox oshp.Rotation
End Sub
Steve Rindsberg
  • 14,442
  • 1
  • 29
  • 34