Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2005.03.06;
Скачать: [xml.tar.bz2];

Вниз

Член группы не найден   Найти похожие ветки 

 
syte_ser78 ©   (2005-02-17 15:00) [0]

Подскажите в чем ошибка

uses ...comobj...;

var
       excel: variant;
       a:string;
begin
       try
               excel := GetActiveOleObject( "excel.Application");
       except
               excel := CreateOLEObject( "excel.Application");
       end;
       excel.cells(1,1):="значение"; //тут сабж выскакивает
       a:=excel.cells(2,1).value; //тут тоже


 
Digitman ©   (2005-02-17 15:12) [1]

какие нафих у объекта excel ячейки ?)..

ячейки случаются у объекта - рабочего листа. который является собственностью объекта - рабочая книга, которая, в свою очередь. является собственностью объекта - Ёхель.Эппликэйшн


 
Alx2 ©   (2005-02-17 15:15) [2]

Вот пример:
(xApp = excel)

sArray : Variant;
begin
...........
  sArray := VarArrayCreate([1, 2, 1, 8], varVariant);

       For m := 1 To 2 Do
         For n := 1 To 8 Do
           sArray[m, n] := "";

       sArray[1, 1] := "№";
       sArray[1, 2] := "Организация";
       sArray[1, 3] := "Адрес";
       sArray[1, 4] := "Руководитель";
       sArray[1, 5] := "Принял";
       sArray[2, 5] := "Должность";
       sArray[2, 6] := "Фамилия";
       sArray[2, 7] := "Подпись";
       sArray[2, 8] := "Дата";

       xApp.Range["A1", "H2"].select;
       xApp.Selection.Value := sArray;

..........
end;


 
syte_ser78 ©   (2005-02-17 15:31) [3]

Или я совсем тупой или совершенно чтото не то делаю

в excelapplication1.ActiveWorkbook.ActiveSheet
cells отсутствует.


 
Digitman ©   (2005-02-17 15:41) [4]

справка к VBAExcel  для Пушкина писана ?

Application object:
Returns a Range object that represents all the cells on the active worksheet. If the active document isn"t a worksheet, this property fails. Read-only.

Range object:
Returns a Range object that represents the cells in the specified range (in other words, it does nothing). Read-only.

Worksheet object:
Returns a Range object that represents all the cells on the worksheet (not just the cells that are currently in use). Read-only.

Remarks

Because the Item property is the default property for the Range object, you can specify the row and column index immediately after the Cells keyword. For more information, see the Item property and the examples for this topic.
Using this property without an object qualifier returns a Range object that represents all the cells on the active worksheet.


 
panov ©   (2005-02-17 21:52) [5]

Вопрос не соответствует теме конференции.



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2005.03.06;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.035 c
1-1109156917
SAVage
2005-02-23 14:08
2005.03.06
Преобразование типов (record<->pointer)


14-1108152620
Virusa
2005-02-11 23:10
2005.03.06
KAV 5.xx


14-1108552074
Ega23
2005-02-16 14:07
2005.03.06
Зацепило. Сильно.


4-1106643434
vogel
2005-01-25 11:57
2005.03.06
Как сделать чтоб прога не отображалась в панели задач


9-1102166895
Макс
2004-12-04 16:28
2005.03.06
Glscene





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский