CreateOleObject

Delphi

06/11/2006

estou tentando criar essas function:

Function Colunas(pFile,pPlan: String): Integer;
var
   XLApp, Sheet: Variant;
begin
   Result := 0;
   XLApp:= CreateOleObject(´Excel.Application´);
   try
      XLApp.WorkBooks.Open(pFile,0,True);
      Sheet  := XLApp.Workbooks[1].WorkSheets[pPlan];
      Result := Sheet.Cells.SpecialCells(11).Column
   finally
      XLApp.Quit
   end
end;

Function Linhas(pFile,pPlan: String): Integer;
var
   XLApp, Sheet: Variant;
begin 
   Result := 0;
   XLApp:= CreateOleObject(´Excel.Application´); 
   try 
      XLApp.WorkBooks.Open(pFile,0,True);
      Sheet  := XLApp.Workbooks[1].WorkSheets[pPlan]; 
      Result := Sheet.Cells.SpecialCells(11).Row 
   finally 
      XLApp.Quit
   end 
end; 


porem está dando erro no ´[b:fc54aa3c34]CreateOleObject[/b:fc54aa3c34]´:
[Pascal Error] Unit4.pas(30): E2003 Undeclared identifier: ´CreateOleObject´


já declarei em uses: OleServer

[color=red:fc54aa3c34][b:fc54aa3c34]como resolver ?[/b:fc54aa3c34][/color:fc54aa3c34]


Fabiano Góes

Fabiano Góes

Curtidas 0
POSTAR