You are right - seems to be some sort of Gadget or Window re-draw issue, if you add a Delay between the creation of the Web Gadgets, you can see that the first WebGadget() is drawn correctly, then 'corrupted' during the drawing of the second WebGadget(). SetGadgetState() does not cure this conflict - for example, SetGadgetState(2,#PB_Web_Refresh) seems to re-draw the first WebGadget() and the second is then not displayed correctly. Apply SetGadget() to both, neither is displayed correctly:
Code: Select all
excelfile1.s="C:\Book1.xls"
excelfile2.s="C:\Book2.xls"
If OpenWindow(0, 220, 0, 600, 400, "Test", #PB_Window_SystemMenu | #PB_Window_TitleBar )
WebGadget(1, 35, 30, 525, 150, excelfile1)
SetGadgetState(1,#PB_Web_Refresh)
Delay(1000)
WebGadget(2, 35, 215, 525, 150, excelfile2)
SetGadgetState(2,#PB_Web_Refresh)
EndIf
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
Switching to the Mozilla ActiveX makes no difference either. If only one WebGadget is displayed, it always works fine. If you run the two-gadget version multiple times, both Web Gadgets then fail to display correctly.
Edit: Ah, just tried again, this time with both xls files containing field values and the files not being identical. Click on a field in Web Gadget 1, the value pops-up in the edit field of Web Gadget 2!

So, not simply a re-draw issue, I think it may be to do with how the fields are identified on a web page - perhaps this is a Microsoft issue rather than a PB issue.