Re: VBA всё-таки недоделанный ... :-(
От: Elena_ Россия  
Дата: 08.09.05 20:15
Оценка: 4 (1)
Здравствуйте, SergX, Вы писали:

SX>Пишу в *.xla MsExcel свои классы. Открываю новую Excel-надстройку, делаю из неё рефренс на надстройку с классами — методы модульного уровня, определённые юзером (мной) новые типы данных, глобальные переменные отображаются, а вот классы нет ((

SX>Можно ли с этим чего-нить сделать

Это не совсем так — если в редакторе VBA в окне свойств раскрыть плюс около класса, то там есть property
instancing, которая может иметь два значения — Private и PublicNotCreatable
The Instancing Property

You might notice that a class module has an additional property in the Properties window, the Instancing property. This property specifies whether the class module should be visible from another project when you have set a reference to the project that contains the class module. The property has two settings, Private, which is the default setting, and PublicNonCreatable. If you set the Instancing property to Private, a project that sets a reference to your project will not be able to view that class module in the Object Browser, nor will it be able to work with an instance of the class. If you set it to PublicNonCreatable, a project that sets a reference to your project can see the class module in the Object Browser. The referencing project can work with an instance of the class, but only if the referenced project has first created that instance. The referencing project cannot actually create the instance itself.

SX>И ещё один вопрос — свойство Application.MacroOption при регистрации своих функций в Ёкселе под своей вывеской (культурно ведь !) в Ексель 2000 с ошибкой, а точно такой же код в 2003 OK, пример:

SX>Application.MacroOptions "Test", "Описание", , , , , "Моя категория"


SX>в 2000 работать не будет, а в 2003 будет. Чего тут можно предложить?


В XP, повидимому и в 2000 тоже в качестве категории можно указывать порядковый номер категории (насколько я понимаю, уже существующей)

Сравним справку по Exvel VBA

Excel XP
Category Optional Variant. An integer that specifies the macro function category (Financial, Date & Time, or User Defined, for example).


Excel 2003

Category Optional Variant. An integer that specifies an existing macro function category (Financial, Date & Time, or User Defined, for example). See the remarks section to determine the integers that are mapped to the built-in categories. You can also specify a string for a custom category. If you provide a string it will be treated as the category name that is displayed in the Insert Function dialog box. If the category name has never been used, a new category is defined with that name. If you use a category name that is that same a built-in name, Excel will map the user defined function to that built-in category.

Пользователь — друг программиста!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.