Share via

VBA Microsoft Programming Accessing Variables across slides

TheOuz 21 Reputation points
2020-06-26T11:56:21.413+00:00

Hello all, can you help?

I am trying to access a variable from slide 2 in a later slide

in the slide 2 code I have declared the variable as public

Public UserName As String

then I have set the value of this inside my button click function

Public Sub SaveName_Click()
    UserName = TextBox1.Value
End Sub

I am trying to access the variable on a later slide by using

Slide2.UserName

However I am having no luck, can anyone advise me on where I am going wrong?

Thank you in advance

Community Center | Not monitored

Answer accepted by question author

Anonymous
2020-06-26T12:09:26.433+00:00

Office development is not currently supported here on QnA. They're actively answering question in dedicated forums here.
https://social.msdn.microsoft.com/forums/office/en-us/home?category=officedev
https://social.msdn.microsoft.com/Forums/en-US/home?forum=isvvba
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_powerpoint-msoffice_custom

--please don't forget to Accept as answer if the reply is helpful--


Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management

Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.