OLE Excel

OLE Excel

Postby Colin Haig » Tue Apr 29, 2014 12:04 pm

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
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: OLE Excel

Postby Jeff Barnes » Tue Apr 29, 2014 2:34 pm

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

Re: OLE Excel

Postby Colin Haig » Tue Apr 29, 2014 2:47 pm

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
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: OLE Excel

Postby Jeff Barnes » Tue Apr 29, 2014 3:17 pm

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

Re: OLE Excel

Postby fafi » Tue Apr 29, 2014 3:39 pm

Hi...try this

Code: Select all  Expand view  RUN

  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
User avatar
fafi
 
Posts: 169
Joined: Mon Feb 25, 2008 2:42 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests