I am trying to replace and save an integer in VBA Powerpoint.
I have a variable in 1 Subroutine named projectId. At the moment, the variable is set to 617. In another subroutine I am running a user input method that prompts the user for a new projectId and stores the new projectId to replace the "617". The only issue is the projectId go to 0 when I close the PowerPoint and reopen it.
Is there any way to physically replace the code projectId = 617 with projectId = 699 for this example.
Below is the code Im working with, notice that projId is a global veriable:
Dim projId As Integer
Sub ChangeProjID()
Dim strProjId As String
Dim intProjId As Integer
strProjId = InputBox("Enter the Project ID given by example:", "Project ID Input")
On Error GoTo NotValidID
intProjId = CInt(strProjId)
projId = intProjId
MsgBox " Your new project ID will be set to " & intProjId & " until changed again"
Exit Sub
NotValidID:
MsgBox " You must enter a valid integer"
End Sub
Public Sub CommentConnect(control As IRibbonControl)
Dim URL As String
projId = 617
URL = "example.com/prID="
ActivePresentation.FollowHyperlink (URL & projId)
End Sub