Newly created macro will not run.

I am trying to create a writer macro that will print only the currently selected page. I recorded the commands File, Print, Pages (current page is selected), OK , and saved the macro as "PCP (print current Page) In My Macros, Standard, new module PCP. The commands I entered do indeed print the current page but nothing happens when I run the macro. This is exactly how I created the same macro in Word. Any suggestions as to what I am doing wrong? I know a macro cannot open a new window - would the print window be considered a new window and this is why it will not work?
Below is a past of what LibreOffice created when I did this. Any help would be appreciated!
Thank you!

sub PCP

dim document   as object
dim dispatcher as object


document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")    
dispatcher.executeDispatch(document, ".uno:Print", "", 0, Array())

end sub