OLE Excel

Post Reply
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

OLE Excel

Post 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
User avatar
Jeff Barnes
Posts: 933
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: OLE Excel

Post 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
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: OLE Excel

Post 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
User avatar
Jeff Barnes
Posts: 933
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Re: OLE Excel

Post by Jeff Barnes »

try this:

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

Replace Book1 with the name of the document
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
fafi
Posts: 169
Joined: Mon Feb 25, 2008 2:42 am

Re: OLE Excel

Post 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
Post Reply