Saludos!!
He tratado de asignar a una variable un gráfico que ya existe en una hoja de excel, lo he tratado de varias maneras y no lo puedo lograr, ¿en donde está mi error? las líneas que estan comentadas son los intentos.
Código Delphi
[-]XLApp: OleVariant;
XLBook: OleVariant;
XLSheet : OleVariant;
XLChart: OleVariant;
Sheets: OleVariant;
graficas: OleVariant;
Grafica: OleVariant;
XLApp := CreateOleObject('Excel.Application');
XLApp.Visible := True;
XLBook:= XLApp.Workbooks.Open('c:\sqv.xlsx');
Sheets:= XLApp.Sheets;
XLSheet:= Sheets.Item['Graf'].Activate;
cuando ejecuto:
Código Delphi
[-]numero: variant;
numero:= XLApp.ActiveSheet.ChartObjects.Count;
si me regresa el número total de gráficas que existen en la hoja.