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

Вниз

Kак открыть файл XLS RaedOnly? помогите ПЛЗ!   Найти похожие ветки 

 
Бывающий   (2004-01-29 12:15) [0]

Что добавить в нижеследующий код для этого?

str = ExtractFilePath(Application->ExeName) + "Templates\\Bill.xls";

Variant V = CreateOleObject("excel.application");
V.Exec(PropertySet("Visible") << true);
V.Exec(PropertyGet("Workbooks")).Exec(Procedure("Open") << str.c_str());


 
Карелин Артем   (2004-01-29 12:30) [1]

VARIANT Open(VARIANT Filename, VARIANT UpdateLinks, VARIANT ReadOnly, VARIANT Format, VARIANT Password, VARIANT WriteResPassword, VARIANT IgnoreReadOnlyRecommended, VARIANT Origin, VARIANT Delimiter, VARIANT Editable, VARIANT Notify, VARIANT Converter );
Соответственно надо в VARIANT ReadOnly передать тру


 
Бывающий   (2004-01-29 12:35) [2]

т.е.

V.Exec(PropertySet("ReadOnly") << true);

?? Не работает, говорит что такого свойства у объекта автоматизации нет.


 
Карелин Артем   (2004-01-29 12:40) [3]

Не-не. ReadOnly у нас параметр метода Open, а не свойство Екселя.


 
Бывающий   (2004-01-29 12:53) [4]

Понимаю, но как это сделать грамотно?

str = ExtractFilePath(Application->ExeName) + "Templates\\Bill.xls";

Variant V = CreateOleObject("excel.application");
V.Exec(PropertySet("Visible") << true);
V.Exec(PropertyGet("Workbooks")).Exec(Procedure("Open") << str.c_str() << PropertyGet("ReadOnly") << true);

??

Тоже не работает ...


 
Карелин Артем   (2004-01-29 13:01) [5]

Может быть что-то из других параметров надо указать?

ReadOnly Optional Variant. True to open the workbook in read-only mode.

IgnoreReadOnlyRecommended Optional Variant. True to have Microsoft Excel not display the read-only recommended message (if the workbook was saved with the Read-Only Recommended option).

Editable Optional Variant. If the file is a Microsoft Excel 4.0 add-in, this argument is True to open the add-in so that it’s a visible window. If this argument is False or omitted, the add-in is opened as hidden, and it cannot be unhidden. This option doesn"t apply to add-ins created in Microsoft Excel 5.0 or later. If the file is an Excel template, True to open the specified template for editing. False to open a new workbook based on the specified template. The default value is False.

Notify Optional Variant. If the file cannot be opened in read/write mode, this argument is True to add the file to the file notification list. Microsoft Excel will open the file as read-only, poll the file notification list, and then notify the user when the file becomes available. If this argument is False or omitted, no notification is requested, and any attempts to open an unavailable file will fail.


 
Бывающий   (2004-01-29 13:06) [6]

V.Exec(PropertyGet("Workbooks")).Exec(Procedure("Open") << str.c_str() << PropertyGet("ReadOnly") << true);
А синтаксис-то мой корректный?


 
Карелин Артем   (2004-01-29 13:15) [7]

Бывающий (29.01.04 13:06) [6]
Не знаю. Мне такой синтаксис незнаком.


 
Бывающий   (2004-01-29 13:33) [8]

Это C++



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

Форум: "Базы";
Текущий архив: 2004.02.25;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.035 c
4-80371
DMichael
2003-12-16 10:50
2004.02.25
Процесс от имени другого пользователя


14-80092
Ega23
2004-02-03 14:01
2004.02.25
Посоветуйте программу


1-79921
HolyMan
2004-02-09 00:05
2004.02.25
Инсталирование нескольких программ


3-79558
denis24
2004-01-29 13:58
2004.02.25
insert into aa.dbf (a,b,c,d) values....


3-79655
xxxx
2004-01-30 16:25
2004.02.25
View vs Table





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский