FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour como hago? excel - radiobutton
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
como hago? excel - radiobutton
Posted: Wed Nov 18, 2015 02:30 PM

Hola.
Tengo una planilla en excel que desde mi app necesito que se seleccione uno de los radio button que tiene esa planilla.
esa planilla a mi me la dan creada, por lo tanto no puedo re-hacerla.

gracias.

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: como hago? excel - radiobutton
Posted: Thu Nov 19, 2015 09:37 AM
Prueba con:

oExcel = CreateObject( "Excel.Application" )
oSheet = oExcel:Get( "ActiveSheet" )
oSheet:Shapes("Option Button 1").ControlFormat.Value = .T.

http://stackoverflow.com/questions/24205454/excel-vba-option-button-selected-as-default-on-start
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: como hago? excel - radiobutton
Posted: Thu Nov 19, 2015 09:54 AM

gracias Antonio!

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: como hago? excel - radiobutton
Posted: Thu Nov 19, 2015 10:08 AM
mi tira el siguiente error:

Source\macro.prg(35) Error E0030 Syntax error: "syntax error at '.'"


en el codigo:
Code (fw): Select all Collapse
  oSheet:shapes("Bot贸ndeopci贸n1176_Haga_clic_en").ControlFormat.Value = .T.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: como hago? excel - radiobutton
Posted: Thu Nov 19, 2015 01:40 PM
Intente:

Code (fw): Select all Collapse
   oSheet:shapes("Bot贸ndeopci贸n1176_Haga_clic_en").Object.Value = .T.
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: como hago? excel - radiobutton
Posted: Thu Nov 19, 2015 03:02 PM

En vez de "." tienes que usar ":"

Prueba as铆:

oSheet:Shapes("Option Button 1"):ControlFormat:Value = .T.

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion