Guideline to X coord Macro

I'm trying to create a macro that will pop up a input box where you can enter the x coord and create a vertical guideline at that location. So far I can get the input to pop up, but after that I get no errors but the guideline is not created. Here's the code I'm currently using. Any suggestions would be greatly appreciated.

Sub CreateGuidelineAtXCoord()
Dim xCoord As Double
Dim activePage As Page

' Get the active page
Set activePage = ActiveDocument.activePage

' Prompt the user for the X-coordinate
xCoord = InputBox("Enter X-coordinate for the guideline:", "Create Guideline")

' Check if the user entered a valid number
If IsNumeric(xCoord) Then
' Create a vertical guideline at the specified X-coordinate
activePage.CreateGuideline cdrVerticalGuideline, xCoord
Else
' Display a message if the user entered an invalid X-coordinate
MsgBox "Invalid X-coordinate entered. Please enter a numeric value.", vbExclamation, "Macro Error"
End If
End Sub