Visio Guy

Visio Discussions => Programming & Code => Topic started by: DJozef87 on October 03, 2011, 03:17:50 PM

Title: Execute a php script without opening the IE page
Post by: DJozef87 on October 03, 2011, 03:17:50 PM
Hello,

I work with Visio and I have a VBA Macro that calls a php page and executes the script without problem.

This script is executed for each Shape of my document so it opens multiple instances of IE at the same time ... the trick is to try to not have to open these pages.
here is the code that calls my page:


Sub openIE(ByVal URL As String)
   Dim myPageURL As String
   myPageURL = URL
   Dim myIE As Object
      Set myIE = CreateObject("InternetExplorer.application" )
      myIE.Navigate(myPageURL)
End Sub


IE.Visible = False didn't work
Title: Re: Execute a php script without opening the IE page
Post by: Jumpy on October 03, 2011, 07:40:48 PM
With createobject you always create a new Instance of IE.
I recommend to use Getobject instead to grap an existing instance of the IE.
If none exists you'll get an error and than u use CreateObject.
Title: Re: Execute a php script without opening the IE page
Post by: DJozef87 on October 04, 2011, 01:10:17 PM
Hello Jumpy,

My problem is that I don't want to open any instance of IE...
Is there another way to call my php script without creating IE instance ?
Title: Re: Execute a php script without opening the IE page
Post by: Jumpy on October 04, 2011, 01:16:27 PM
Oh, didn't see that you don't want any browser. So maybe sth. like this:

http://www.daniweb.com/web-development/php/threads/232258
Title: Re: Execute a php script without opening the IE page
Post by: DJozef87 on October 04, 2011, 03:37:16 PM
And I can put this call from VBA ?
the problem is that I pass parameters with the call so my only way is to create the IE instance without opening the browser  :-\
Title: Re: Execute a php script without opening the IE page
Post by: Jumpy on October 04, 2011, 08:04:37 PM
You can use the shell from VBA. Search google for Shell, Shellexecute, sth. like that.
Should be no problem, to pass parameters along.
(! If this happens locally, not if the Script has to be executed on a webserver or sth. like that !)
Title: Re: Execute a php script without opening the IE page
Post by: DJozef87 on October 20, 2011, 02:39:29 PM
I solved this problem using HttpRequest...