I have code that I have tested and now want to add a user form with a cancel and OK button to run or cancel it. I have looked at various answers to call the sub, but I can’t get it to work. I have made all the sub being called "Public". Any help would be appreciated.
Regards,
Tom
The following is in "responses.xlsm - sheet1 (code) (General) - update tracking"
Public Sub update_trackingFile()
' Routing to take responses from a google form's spreadsheet. It will also email a response to
' the requester's email
' makes sure the Roster file is open
mylocalpath = ThisWorkbook.Path
MyActivefile = ThisWorkbook.FullName
With MyActivefile
' confirm that the roster file is open and the version you want
Call OfferRosterFile
' Insert the email address in the response file
Call insertEmail
.
.
.
Public Sub showDialogBox()
UpdateForm.Show
End Sub
The following is in "responses.xlsm – updateform (code) UserForm – click"
Public Sub CancelButton_Click()
Unload UpdateForm
End Sub
Public Sub OKButton_Click()
ThisWorkbook.Activate
With ThisWorkbook
Call update_trackingFile ‘ get sub or function not defined.
End With
End Sub
Public Sub UserForm_Click()
End SubI have code that I have tested and now want to add a user form with a cancel and OK button to run or cancel it. I have looked at various answers to call the sub, but I can’t get it to work.
The following is in responses.xlsm - sheet1 (code) (General) - update tracking
Public Sub update_trackingFile()
' Routing to take responses from a google form's spreadsheet. It will also email a response to
' the requester's email
' makes sure the Roster file is open
mylocalpath = ThisWorkbook.Path
MyActivefile = ThisWorkbook.FullName
With MyActivefile
' confirm that the roster file is open and the version you want
Call OfferRosterFile
' Insert the email address in the response file
Call insertEmail
.
.
.
Public Sub showDialogBox()
UpdateForm.Show
End Sub
The following is in responses.xlsm – updateform (code) UserForm – click
Public Sub CancelButton_Click()
Unload UpdateForm
End Sub
Public Sub OKButton_Click()
ThisWorkbook.Activate
With ThisWorkbook
Call update_trackingFile ‘ get sub or function not defined.
End With
End Sub
Public Sub UserForm_Click()
End Sub
Regards,
Tom
The following is in "responses.xlsm - sheet1 (code) (General) - update tracking"
Public Sub update_trackingFile()
' Routing to take responses from a google form's spreadsheet. It will also email a response to
' the requester's email
' makes sure the Roster file is open
mylocalpath = ThisWorkbook.Path
MyActivefile = ThisWorkbook.FullName
With MyActivefile
' confirm that the roster file is open and the version you want
Call OfferRosterFile
' Insert the email address in the response file
Call insertEmail
.
.
.
Public Sub showDialogBox()
UpdateForm.Show
End Sub
The following is in "responses.xlsm – updateform (code) UserForm – click"
Public Sub CancelButton_Click()
Unload UpdateForm
End Sub
Public Sub OKButton_Click()
ThisWorkbook.Activate
With ThisWorkbook
Call update_trackingFile ‘ get sub or function not defined.
End With
End Sub
Public Sub UserForm_Click()
End SubI have code that I have tested and now want to add a user form with a cancel and OK button to run or cancel it. I have looked at various answers to call the sub, but I can’t get it to work.
The following is in responses.xlsm - sheet1 (code) (General) - update tracking
Public Sub update_trackingFile()
' Routing to take responses from a google form's spreadsheet. It will also email a response to
' the requester's email
' makes sure the Roster file is open
mylocalpath = ThisWorkbook.Path
MyActivefile = ThisWorkbook.FullName
With MyActivefile
' confirm that the roster file is open and the version you want
Call OfferRosterFile
' Insert the email address in the response file
Call insertEmail
.
.
.
Public Sub showDialogBox()
UpdateForm.Show
End Sub
The following is in responses.xlsm – updateform (code) UserForm – click
Public Sub CancelButton_Click()
Unload UpdateForm
End Sub
Public Sub OKButton_Click()
ThisWorkbook.Activate
With ThisWorkbook
Call update_trackingFile ‘ get sub or function not defined.
End With
End Sub
Public Sub UserForm_Click()
End Sub