Page 1 of 1

Quick & Dirty (XL) Grid Gadget embedded in PB WebGadget

Posted: Thu Jul 05, 2007 5:47 pm
by naw

Code: Select all

OpenWindow(1,100,100,420,420,"Embedded XLS")
CreateGadgetList(WindowID(1))
Delay(1000)
WebGadget(1,10,10,200,200,"C:\MyFile.xls")

Repeat
EVENT = WaitWindowEvent()
Select EVENT
   Case #PB_Event_CloseWindow: Delay(2000): End
EndSelect

ForEver
MyFile.xls has the following VBA (press <ALT>F11 in Excel) in the "ThisWorkBook" Section:

Code: Select all

Private Sub Workbook_Activate()
'    ActiveWindow.DisplayHeadings = 0
'    ActiveWindow.DisplayWorkbookTabs = 0
    Application.ShowStartupDialog = 0
    Application.DisplayFormulaBar = 0
    Application.DisplayStatusBar = 0
    Application.ShowWindowsInTaskbar = 0
End Sub

Private Sub Workbook_DeActivate()
    ThisWorkbook.Saved = True
'   ActiveWindow.DisplayHeadings = 1
'   ActiveWindow.DisplayWorkbookTabs = 1
    Application.ShowStartupDialog = 1
    Application.DisplayFormulaBar = 1
    Application.DisplayStatusBar = 1
    Application.ShowWindowsInTaskbar = 1
    ThisWorkbook.Save
End Sub
So does anyone have a better way of embedding XL into PB? I know this is clunky but it works...