Select an open excel-sheet
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Select an open excel-sheet
Hi,
I know how to create,open, edit and save an excel-sheet.
But is it possible to select a sheet that is already open?
I want to press a button, and than select the excell-sheet (in case if more than 1 sheet is open) that the program have to modify/use.
Thanks
I know how to create,open, edit and save an excel-sheet.
But is it possible to select a sheet that is already open?
I want to press a button, and than select the excell-sheet (in case if more than 1 sheet is open) that the program have to modify/use.
Thanks
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- joseluisysturiz
- Posts: 2024
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: Select an open excel-sheet
Intenta asi...Marc Vanzegbroeck wrote:Hi,
I know how to create,open, edit and save an excel-sheet.
But is it possible to select a sheet that is already open?
I want to press a button, and than select the excell-sheet (in case if more than 1 sheet is open) that the program have to modify/use.
Thanks
oHoja := oExcel:ActiveSheet() // SINO ESPECIFICAS QUE HOJA, TOMARA POR DEFECTO LA HOJA1
oExAngu:Sheets("COLUMNAS"):Select() // SELECCIONO Y ME CAMBIO A LA HOJA(pestaña) COLUMNAS Q VOY A LEER
oHoja := oExAngu:ActiveSheet() // ACTIVO HOJA SELECCIONADA, SINO ESPECIFICAS QUE HOJA, TOMARA POR DEFECTO LA HOJA1
oHoja:Cells(2, 4):Select() // POSICIONA EL CURSO EN LA CELDA ESPECIFICADA(D8) PARA LEER COLUMNA( row, col / fila, col)
saludos, gracias...
Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Select an open excel-sheet
Thank you,
I will try it.
I will try it.
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Re: Select an open excel-sheet
Code: Select all
oSheet:= oExcel:WorkSheets(<cNameSheet>)
Last edited by hmpaquito on Wed Oct 17, 2018 7:25 am, edited 1 time in total.
- joseluisysturiz
- Posts: 2024
- Joined: Fri Jan 06, 2006 9:28 pm
- Location: Guatire - Caracas - Venezuela
- Contact:
Re: Select an open excel-sheet
Gracias por la informacion, saludos...hmpaquito wrote:Code: Select all
oSheet:= oExcel:WorkSheets(<cNameSheet>) // Now oSheet == oExcel:ActiveSheet()
Dios no está muerto...
Gracias a mi Dios ante todo!
Gracias a mi Dios ante todo!
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Select an open excel-sheet
Hello,
I didn't get it to work.
Maybe my question was not really clear.
What I want to do is:
- Press a button in my programm
- The program wait till I select the sheet of the excellbook that I want to use (because more than 1 excell-books can be open)
- After selecting the sheet I want to use, the program use that sheet, and get the information of that sheet
I didn't get it to work.
Maybe my question was not really clear.
What I want to do is:
- Press a button in my programm
- The program wait till I select the sheet of the excellbook that I want to use (because more than 1 excell-books can be open)
- After selecting the sheet I want to use, the program use that sheet, and get the information of that sheet
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Re: Select an open excel-sheet
ok !What I want to do is:
- Press a button in my programm
Make it in programm shown buttons labeled with sheet names.The program wait till I select the sheet of the excellbook that I want to use (because more than 1 excell-books can be open)
oSheet:= oExcel:WorkSheets(cSheetSelectedFromButton)After selecting the sheet I want to use, the program use that sheet, and get the information of that sheet
regards
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Select an open excel-sheet
Hello,
I tested it with
but I get an error
I tested it with
Code: Select all
oExcel = CREATEOBJECT( "Excel.Application" )
oSheet:= oExcel:WorkSheets('MYPAGE')
- Error description: Error Excel.Application/16389 E_FAIL: WORKSHEETS
Args:
[ 1] = C MYPAGE
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Select an open excel-sheet
Try this:
EMG
Code: Select all
oSheet = oExcel:Sheets( "MySheet" )
Re: Select an open excel-sheet
Friends:
It looks like we can use numbers too.
oSheet = oExcel:Sheets(2)
Regards
It looks like we can use numbers too.
oSheet = oExcel:Sheets(2)
Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Select an open excel-sheet
Yes, of course. Items of Microsoft collections like Sheets can be accessed by position number or string key.
EMG
EMG
Re: Select an open excel-sheet
Hi,
If the excel sheet is open by the user.
How is it possible to get the contents for the current active cell with fivewin .
How to know the x,y coord of the cell in the sheet .
Thanks .
If the excel sheet is open by the user.
How is it possible to get the contents for the current active cell with fivewin .
How to know the x,y coord of the cell in the sheet .
Thanks .
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Select an open excel-sheet
Code: Select all
oExcel := ExcelObj()
oCell := oExcel:ActiveCell
if oCell != nil
? oCell:Value
? oCell:Address
? oCell:Row
? oCell:Column
endif
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Select an open excel-sheet
Greet , perfect,
Philippe
Philippe