954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Get data from remote file/database VBA.

Hi. I need to make a system where I can accept input from the audience, and it'll show live on a PowerPoint Slide. I can create the user input system, but I don't know how to make a PowerPoint macro that when run will either:
Retrieve text from a remote text file
Get content from a webpage
Or get data from a MySQL database (preferred)

I've found a code that should read a text file, but when I run the macro, I get
Run-time error '424':

Object Required

My code is:

Sub readFile()
        Dim address As String
        address = "http://www.mysite.com/file.txt"
        Dim returnValue As String

        returnValue = WebClient.DownloadString(address)
        ActivePresentation.Slides(1).Shapes("nameOfShape").TextFrame.TextRange.Text = returnValue
End Sub


Any help with any of the options is greatly appreciated.

Thanks.Or, if anyone can tell me how to embed a web page on a PPT slide on a mac (so that it'll update on slide enter), that will work too.

Another option would be to pull an image from a server on slide enter. Is that possible?

calebcook
Junior Poster in Training
66 posts since Jun 2011
Reputation Points: 10
Solved Threads: 4
 

You could try following these instructions before using the return value for the presentation (line 6).

These use the Input method:

http://stackoverflow.com/questions/938796/vba-read-lines-from-text-file-exclude-top-two-lines

http://vbadud.blogspot.com/2007/06/vba-read-text-files-with-leading.html

StephNicolaou
Posting Whiz in Training
204 posts since Nov 2007
Reputation Points: 77
Solved Threads: 18
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: