Take string from textbox in powerpoint and populate cell in excel. please help....

soultrappa

New Member
Joined
Dec 9, 2014
Messages
1
Hi All,</SPAN>

I am trying to get a sign up sheet embedded onto the end of a powerpoint presentation. There are four textboxes - Forename, Surname, Email and network id that the user can enter information.</SPAN>

I need that information to populate cells in Excel for e.g the header line would be the same categories as the textboxes. I need the forname to populate say cell B1, surname B2, email B3 and network id B4.</SPAN>

If the B1 - B4 row is already populated then i need it to add a new row and populate in the new row. </SPAN>

I have had a little experience with visual studio but find that VBA is somewhat different. I thought i could just call the workbook - open it - minimise it then have the whole
Code:
 txt1.value = (file path to workbook), (worksheet), (create row), (cell).
</SPAN>

I am currently using the code below

Code:
Sub Open_excel()

Dim wkb As Workbook
Set wkb = Workbooks.Open("C:\Users\jason.francis\Documents\DHREL.xlsx")
'Dim excel As excel.Application
'Set excel = CreateObject("excel.application")
'excel.Workbook.Open ("C:\Users\jason.francis\Documents\DHREL.xlsx")

End Sub

Public Sub Clear_form()

lblfname.Caption = ""
lblsname.Caption = ""
lblemai.Caption = ""
lblnuhid.Caption = ""

End Sub

Private Sub Submit_Click()

'remembers text in textboxes
Dim fname As String
Dim sname As String
Dim emai As String
Dim nuhid As String

'places text in textbox to memory
fname = Txtfname.Text
sname = Txtsname.Text
emai = Txtemai.Text
nuhid = Txtnuhid.Text

'adds text from txtbox to labels
lblfname.Caption = fname
lblsname.Caption = sname
lblemai.Caption = emai
lblnuhid.Caption = nuhid
 
Workbooks.Open ("C:\Users\jason.francis\Documents\DHREL.xlsx")
Workbook.Activate
ActiveWindow.WindowState = xlMinimized

'Workbooks.Open ("C:\Users\jason.francis\Documents\DHREL.xlsx")
'ThisWorkbook.Activate

End Sub
</SPAN>

Unfortunately it will not open the workbook and i get an error message at the Thisworkbook.Activate stage – error is Run-time1004 Method’ThisWorkbook’ of object’_global’ failed. When i ctrl alt del i can see that excel has opened and there seems to be an invisible instance of a workbook that i cannot get focus off nor close.</SPAN>

Other info - as you can see from the coding i have a submit command button and some labels which will display the info to the user.</SPAN>

Any help sure would be appreciated and if you have the time a brief explanation as to why you have written the code (as apposed to heres some code try this).</SPAN>

Thanks in advance.</SPAN>
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top