Текущий архив: 2006.02.12;
Скачать: CL | DM;
ВнизExcel Найти похожие ветки
← →
Антон1209 (2006-01-23 09:28) [0]Подскажите как в Excel получить наименование всех именованных областей?
← →
Digitman © (2006-01-23 09:40) [1]цитата из станд.справке к ExcelVBA:
Using the Names Collection
Use the Names property to return the Names collection. The following example creates a list of all the names in the active workbook, plus the addresses they refer to.
Set nms = ActiveWorkbook.Names
Set wks = Worksheets(1)
For r = 1 To nms.Count
wks.Cells(r, 2).Value = nms(r).Name
wks.Cells(r, 3).Value = nms(r).RefersToRange.Address
Next
← →
Антон1209 (2006-01-23 09:59) [2]спасибо
← →
Антон1209 (2006-01-23 10:26) [3]---------------------------
Debugger Exception Notification
---------------------------
Project GenRep.exe raised exception class EOleError with message "Method "Name" not supported by automation object". Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
← →
Digitman © (2006-01-23 10:34) [4]Значит, у тебя ошибка в 17-й строке..
← →
Антон1209 (2006-01-23 14:55) [5]---------------------------
Debugger Exception Notification
---------------------------
Project GenRep.exe raised exception class EVariantInvalidArgError with message "Invalid argument". Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
var
v_Tmp: variant;
Xlap, IWorkbook: variant;
r: integer;
begin
try
XLap:=CreateOLEObject("Excel.Application");
IWorkbook:=Xlap.workbooks.add("C:\GenRep\r_count_mo.xls");
v_Tmp:=IWorkbook.Names;
for r:=1 to v_Tmp.Count do
begin
ComboBox1.Items.Add(v_Tmp[r].Name);
end;
except
XLap.Quit;
end;
end;
← →
Антон1209 (2006-01-23 15:23) [6]ошибка в строке
ComboBox1.Items.Add(v_Tmp[r].Name);
← →
Digitman © (2006-01-23 15:54) [7]procedure TForm1.Button1Click(Sender: TObject);
var
v_Tmp: OLEvariant;
Xlap, IWorkbook: OLEVariant;
r: integer;
begin
XLap:=CreateOLEObject("Excel.Application");
try
IWorkbook:=Xlap.workbooks.Open("C:\r_count_mo.xls");
v_Tmp:=IWorkbook.Names;
for r:=1 to v_Tmp.Count do
begin
ComboBox1.Items.Add(v_Tmp.Item(r).Name);
end;
finally
Xlap.Quit;
end;
end;
← →
Антон1209 (2006-01-23 16:05) [8]спасибо понял
Страницы: 1 вся ветка
Текущий архив: 2006.02.12;
Скачать: CL | DM;
Память: 0.45 MB
Время: 0.037 c