CreateObject("Excel","//server"), MsgBox output 
Author Message
 CreateObject("Excel","//server"), MsgBox output

Assuming an excel-file exists on a server (192.168.1.1) containing following
macro:

    Sub doSomething()
        'code for connecting to database
        'code for requests to the db

        MsgBox "an error occured while requesting the base !"  <-- key issue

        'code for filling up worksheets with the results.
    End Sub

When locally executing the macro the MsgBox pops up, ok.

Now i want to call the macro from an remote-host out of an html-file.

<HTML>
    [...]
    <SCRIPT Language=VBScript>
       Dim var1
       Set var1 = CreateObject("Excel.Application", "192.168.1.1")
       var1.Workbooks.Open "excelFile"
       var1.Run "excelFile!doSomething"
       var1.Visible = TRUE
    </SCRIPT>
    [...]
</HTML>

Then, providing the correct security preferences, on 192.168.1.1 excel is
started and the execution of "doSomething" begins.

PROBLEM: When execution arrives at the "MsgBox"-command, neither on the
server nor on the client a MessageBox pops up and the macro hangs.

Is there an possibility to "turn around" the output of an macro to the
client, when it is executed remotely ?

Thanks in advance,

Kai.




Tue, 04 Feb 2003 03:00:00 GMT  
 CreateObject("Excel","//server"), MsgBox output
Kai,

Sorry, but it isn't possible to catch UI elements from objects when creating
them remotly. Make sure all the code in the macro can run without any UI. If
an error occures use the err.raise to catch the error at the client and
display your UI from there.

HTH,

BVR


Quote:

> Assuming an excel-file exists on a server (192.168.1.1) containing
following
> macro:

>     Sub doSomething()
>         'code for connecting to database
>         'code for requests to the db

>         MsgBox "an error occured while requesting the base !"  <-- key
issue

>         'code for filling up worksheets with the results.
>     End Sub

> When locally executing the macro the MsgBox pops up, ok.

> Now i want to call the macro from an remote-host out of an html-file.

> <HTML>
>     [...]
>     <SCRIPT Language=VBScript>
>        Dim var1
>        Set var1 = CreateObject("Excel.Application", "192.168.1.1")
>        var1.Workbooks.Open "excelFile"
>        var1.Run "excelFile!doSomething"
>        var1.Visible = TRUE
>     </SCRIPT>
>     [...]
> </HTML>

> Then, providing the correct security preferences, on 192.168.1.1 excel is
> started and the execution of "doSomething" begins.

> PROBLEM: When execution arrives at the "MsgBox"-command, neither on the
> server nor on the client a MessageBox pops up and the macro hangs.

> Is there an possibility to "turn around" the output of an macro to the
> client, when it is executed remotely ?

> Thanks in advance,

> Kai.





Fri, 07 Feb 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. CreateObject("Excel","//server"), MsgBox output

2. Server.CreateObject("Excel.Application")

3. GetObject("","InternetExplorer.Application") fails in Excel VBA

4. GetObject("","InternetExplorer.Application") fails in Excel VBA

5. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

6. Createobject, excel "times out"

7. CreateObject("Excel.Sheet")

8. Set xLApp = CreateObject("Excel.Application")

9. CreateObject("Excel.Application") Fails on NT

10. CreateObject("Excel.Application") problem

11. CreateObject("Excel.Application")

12. CreateObject("Excel.Application")

 

 
Powered by phpBB® Forum Software