Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / November 2007

Tip: Looking for answers? Try searching our database.

Problems w\ Macro to connect Worksheet object to TextBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iamito - 29 Nov 2007 20:15 GMT
Hi

I want to create an interactive slide in Powerpoint that connects a
worksheet object to a Textbox, but I can't seem to do it.

This is what I've written so far:

Private Sub TextBox1_Change()

Dim num As Double

num = TextBox1.Value

If IsNumeric(num) Then
Excel.Application.Activate.Sheet(1).Range("C8").Value = num
Else
MsgBox ("Please enter numbers only")
End If

End Sub

Any help would be greatly appreciated.

Miguel
Steve Rindsberg - 30 Nov 2007 17:28 GMT
In article <a08a52ae-472b-41f8-9cf1-4b305390189f@e1g2000hsh.googlegroups.com>,
Miguel,

Try this instead:

Private Sub Test()

   Dim num As Double
   
   ' You need to set a reference to the MS Excel object library
   ' using Tools, References:
   Dim oSheet As Excel.Worksheet
   ' or do this instead:
   ' Dim oSheet as Object
   
   num = 22
   
   ' change the following to the correct slide number and
   ' object name.  
   ' Watch out for linebreak ... this should all be one line:
   Set oSheet = ActivePresentation.Slides(4).Shapes("Object
5").OLEFormat.Object.Worksheets(1)
   
   
   With oSheet
       .Range("C8").Value = num
   End With

End Sub

Iamito wrote:
> Hi
>
[quoted text clipped - 18 lines]
>
> Any help would be greatly appreciated.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.