Page 1 of 1

OLE Excel

Posted: Tue Apr 29, 2014 12:04 pm
by Colin Haig
Hi All

Is it possible to make excel open full screen instead of just flashing the excel icon on the taskbar.

I use this - oExcel:Visible := TRUE

Regards

Colin

Re: OLE Excel

Posted: Tue Apr 29, 2014 2:34 pm
by Jeff Barnes
This is per the Microsoft Knowledge Base article #886217:

To resolve this issue, modify the value of the ForegroundLockTimeout registry entry in Registry Editor. To do this, follow these steps:
1 Click the Start Orb, click Run, type regedit in the Open box, and then click OK.
2 In Registry Editor, locate and then click the following registry subkey:
HKEY_CURRENT_USER\Control Panel\Desktop
3 In the right pane, locate and then double-click ForegroundLockTimeout.
4 Under Base, click Decimal, type 0 in the Value data box, and then click OK. Note The default decimal value for the ForegroundLockTimeout registry entry is set as 200000.
5 Quit Registry Editor.
6 Restart your computer.

Or you can run this reg file:
http://www.can-soft.net/temp/ForegroundLockTimeOut.reg

Re: OLE Excel

Posted: Tue Apr 29, 2014 2:47 pm
by Colin Haig
Hi Jeff

Thanks but I would rather not start playing around with clients terminal server and workstations registry settings.
They will just have to click on the icon to open the spreadsheet.

Cheers

Colin

Re: OLE Excel

Posted: Tue Apr 29, 2014 3:17 pm
by Jeff Barnes
try this:

BringWindowToTop( FindWindow( 0, "Microsoft Excel - Book1" ) )

Replace Book1 with the name of the document

Re: OLE Excel

Posted: Tue Apr 29, 2014 3:39 pm
by fafi
Hi...try this

Code: Select all | Expand


  cFile:="e:\dtd\dtd.xlsx"
  oExcel := TOleAuto():New( "Excel.Application" )
  oExcel:WorkBooks:Open(ALLTRIM(cFile))
  oSheet := oExcel:ActiveSheet()
  oExcel:Visible = .T.
  hWnd:=oExcel:hWnd
  ShowWindow(hWnd, 3) //SW_MAXIMIZE=3 SW_NORMAL=1 SW_MINIMIZE=6
  BringWindowToTop(hWnd)
 


regards
fafi