mastouille.fr est l'un des nombreux serveurs Mastodon indépendants que vous pouvez utiliser pour participer au fédiverse.
Mastouille est une instance Mastodon durable, ouverte, et hébergée en France.

Administré par :

Statistiques du serveur :

645
comptes actifs

#vba

0 message0 participant0 message aujourd’hui
В блоге, а потом и в книге Joel Spolsky была расписана история появления #VBA в том самом Microsoft #Excel.

Этот персонаж так же потом сделал #stackoverflow и вообще известный графоман от #softwaredevelopment, сродни Лебедеву от дизайна — https://neolurk.org/wiki/Джоэл_Спольски
———

В допотопные времена в Excel был очень неудобный язык программирования, которому не дали названия. Мы называли его «макросы Excel». Он был весьма ограничен – без переменных (значения приходилось хранить в ячейках таблицы), локальных переменных и вызовов подпрограмм – короче, сопровождать такой язык было практически невозможно. В нем имелись некоторые более сложные функции вроде Goto, но метки были скрыты от глаз.

Единственное, что его оправдывало, это явное превосходство над макросами Lotus, представлявшими собой лишь длинную строку последовательности нажатий клавиш, вводимую в ячейку таблицы.

17 июня 1991 года я приступил к работе в Microsoft в составе команды Excel. Моя должность называлась Program Manager. Предполагалось, что я как&то решу проблемы языка. Подразумевалось, что это решение будет связано с языком программирования Basic.

Basic? Фу!

Некоторое время я вел переговоры с разными группами разработчиков. Только что появился Visual Basic 1.0, выглядевший довольно круто. Также имелся неудачный проект под кодовым названием MacroMan и еще один проект – создание объектно-ориентированного языка Basic – под кодовым названием Silver. Команде Silver было сказано, что первый клиент для их продукта уже есть – это Excel. Менеджер по маркетингу проекта Silver Боб Уаймен (Bob Wyman) – да, тот самый – мог продать свою технологию только мне.

Проект MacroMan, как я сказал, был неудачным, и с некоторым трудом его все же удалось закрыть. Команда Excel убедила команду Basic в том, что ей нужен особый вариант Visual Basic для Excel. Моими стараниями в Basic включили четыре вещи, которые мне очень нравились. Был добавлен структурный тип данных Variant, позволяющий хранить данные любого типа, потому что иначе сохранить в переменной содержимое ячейки рабочего листа можно было только с помощью оператора переключения. Также было добавлено позднее связывание, ныне известное как IDispatch, или COM&автоматизация, потому что исходный проект Silver требовал глубокого понимания системы типов, чего трудно было ожидать от тех, кто станет писать макросы. И еще я получил две свои любимые синтаксические конструкции – For Each, украденную из csh, и With, украденную из Pascal.

Потом я засел за написание спецификации Excel Basic – огромного документа, разросшегося до сотен страниц, – думаю, в конце их стало не меньше пятисот. («Каскадное проектирование» – усмехнетесь вы. Да-да, приятель, оно самое.)

В те времена существовало понятие «рецензирования БиллГ». Практически любой крупной и важной функции требовалась оценка Билла Гейтса. Мне сказали послать в его офис на рецензию экземпляр спецификации (фактически, это целый том лазерных распечаток).

Я тут же напечатал и отослал ее. В тот день у меня оставалось немного свободного времени, и я стал размышлять над тем, достаточно ли в Basic функций для работы с датами и временем, чтобы делать с ними все то, что позволяет Excel.

В большинстве программных сред даты хранятся в виде действительных чисел. При этом целая часть – это количество дней, истекших с некой оговоренной даты в прошлом, называемой началом эпохи (epoch). В Excel сегодняшняя дата 16 июня 2006 года хранится как число 38884, за точку отсчета принято 1 января 1900 года.

Я стал экспериментировать с различными функциями даты и времени Basic и Excel и обнаружил в документации Visual Basic нечто странное: в Basic началом эпохи считалось 31 декабря 1899 года, а не 1 января 1900 года, но по каким-то причинам сегодняшняя дата и в Excel, и в Basic представлялась одинаково.

Что?!
Я стал искать разработчика Excel, достаточно старого, чтобы помнить такие вещи. Похоже, ответ знал Эд Фрайз (Ed Fries).

– Ха, – сказал он мне, – проверь 28 февраля 1900 года.
– 59, – отвечал я.
– Теперь 1 марта 1900 года.
– 61!
– А где 60? – спросил Эд.
– 29 февраля 1900 года, год был високосным! Он делится на 4!
– Мысль интересная, но неверная, – сказал Эд, оставив меня в недоумении.

Пришлось провести некоторые исследования. Оказалось, что годы, которые делятся на 100, бывают високосными, только если при этом еще делятся на 400.
1900-й год не был високосным.
– В Excel ошибка! – воскликнул я.
– Не совсем так, – возразил Эд. – Нам пришлось пойти на это, чтобы импортировать таблицы Lotus 1-2-3.
– Значит, ошибка в Lotus 1-2-3?
– Да, но, скорее всего, умышленная.

Требовалось уместить Lotus в 640 Kбайт – не так много памяти. Если не обращать внимания на 1900 год, то можно проверить год на високосность по двум правым разрядам числа – они должны быть нулевыми. Быстро и легко. Наверное, ребята из Lotus решили, что ничего не случится, если какие&то два месяца в далеком прошлом будут считаться неправильно. Похоже, разработчики Basic дотошно учли эти два месяца, сдвинув эпоху на день назад.
– Вон оно что, – сказал я и стал выяснять, что означает флажок 1904 Date System (Система дат 1904) в окне параметров.
На следующий день должно было состояться рецензирование БиллГ.

30 июня 1992 года.
В те дни в Microsoft было гораздо меньше бюрократии. Это сейчас там одиннадцать или двенадцать уровней управления, а тогда я подчинялся Майку Конте (Mike Conte), который подчинялся Крису Грэму (Chris Graham), который подчинялся Питу Хиггинсу (Pete Higgins), который подчинялся Майку Мэйплзу (Mike Maples), который подчинялся Биллу. Всего примерно шесть уровней иерархии. Мы еще посмеивались над компаниями вроде General Motors, где этих уровней было восемь или около того.
На моем рецензировании БиллГ присутствовала вся иерархическая цепочка вместе с родными и двоюродными сестрами и тетками, а также человек из моей команды, который должен был точно подсчитать, сколько раз Билл скажет f… (чем меньше, тем лучше).

Вошел Билл.
Я подумал: как странно, что у него тоже две ноги, две руки, одна голова и так далее – совсем как у обычных людей.
В руках у него была моя спецификация.
В руках у него была моя спецификация!
Он сел, обменявшись с кем-то из незнакомых мне управленцев шуткой, смысл которой до меня не дошел. Несколько человек рассмеялись.
Билл повернулся ко мне.
Я заметил комментарии на полях моей спецификации. Он прочел первую страницу!
Он прочел первую страницу моей спецификации и что-то написал на ее полях!
Если учесть, что мы послали ему спецификацию всего 24 часа назад, он должен был читать ее накануне вечером.

Он стал задавать вопросы. Я отвечал. Вопросы были достаточно простыми, но я не в силах их вспомнить, потому что неотрывно следил за тем, как он листает спецификацию…
Он листал спецификацию! [Успокойся, ты же не маленькая девочка!]

И НА ВСЕХ ПОЛЯХ БЫЛИ ПОМЕТКИ. НА КАЖДОЙ СТРАНИЦЕ. ОН ПРОЧЕЛ ВСЮ ЭТУ ЧЕРТОВУ СПЕЦИФИКАЦИЮ И НАПИСАЛ ЗАМЕЧАНИЯ НА ПОЛЯХ.
Он Прочел Все! [БОЖЕ МИЛОСТИВЫЙ!]
Вопросы становились более сложными и детальными.
Они казались несколько случайными. Я уже был готов считать Билла своим приятелем. Какой славный малый! Он прочел мою спецификацию!
Он, наверное, хочет задать мне несколько вопросов, связанных с заметками на полях! Я занесу все его замечания в систему контроля ошибок и прослежу, чтобы все они были учтены, и как можно скорее!

И вот решающий вопрос.
– Не знаю, ребята, – сказал Билл, – есть здесь кто-нибудь, кто действительно в деталях разбирается, как это сделать? Например, все эти функции даты и времени. В Excel их очень много. Будут ли такие же функции в Basic?
И будут ли они работать точно так же?
– Да, – ответил я, – кроме января и февраля 1900 года.
Тишина.

«Счетчик f» и мой босс изумленно переглянулись. Откуда он это взял?
Января и февраля КАКОГО ГОДА?
– ОК. Хорошая работа, – сказал Билл. Он взял свой размеченный экземпляр спецификации.
…Погодите! Я же хотел…
И вышел.

– Четыре, – объявил «счетчик f», и все заговорили, что такого низкого счета на их памяти не было и что Билл с годами становится мягче. Ему тогда было 36.

Позже мне все объяснили.
«На самом деле, Билл не собирается обсуждать твою спецификацию, ему просто нужно убедиться, что ты владеешь темой. Его обычный стиль – задавать вопросы все сложнее и сложнее, пока он не уличит тебя в каком-нибудь незнании, и тогда можно сделать тебе выволочку за неподготовленность. Никто не знал, что произойдет, если кто-то ответит на самый трудный его вопрос, потому что такого раньше не случалось».

– Если бы на этом совещании был Джим Манци, – сказал кто-то, – он спросил бы, что такое функция даты.

Джим Манци (Jim Manzi) – это тот менеджер с MBA, задачей которого было загнать в гроб Lotus.

Замечание было верным. Билл Гейтс поразительно разбирался в технических деталях. Он понимал, что такое Variant, COM&объекты, IDispatch, и чем автоматизация отличается от vtables, и как возникают двойственные интерфейсы. Его интересовали функции даты. Он не влезал в программу, если доверял тем, кто над ней работает, но его нельзя было провести на мякине, потому что он сам был программистом. Настоящим, действующим программистом.

Смотреть, как непрограммист пытается управлять софтверной компанией – все равно что наблюдать за новичком серфингистом.
«Все отлично! У меня на берегу отличные помощники, которые подсказывают мне, что нужно делать!» – говорит он и снова падает в воду. Типичное поведение администратора, считающего управление универсальной функцией. Не повторит ли Стив Балмер подвиг Джона Скалли, который едва не довел Apple до исчезновения, хотя совет директоров посчитал, что торговля пепси-колой – подходящая подготовка для руководителя компьютерной фирмы? Поклонники MBA склонны полагать, что справятся с управлением организацией, в работе которой они не разбираются.

———
Перевод на русский язык этой публикации найти более не удаётся, взята из книги «Джоэл: и снова о программировании» ISBN 978-5-93286-144-8

#программирование #programming #software #Microsoft @russian_mastodon @ru @Russia
idealists.suAkkoma

В блоге, а потом и в книге Joel Spolsky была расписана история появления #VBA в том самом Microsoft #Excel.

Этот персонаж так же потом сделал
#stackoverflow и вообще известный графоман от #softwaredevelopment, сродни Лебедеву от дизайна — https://neolurk.org/wiki/Джоэл_Спольски
———
История в приложенном файле (ограничение на число символов не позволяет разместить в посте).
———
Перевод на русский язык этой публикации найти более не удаётся, взято из книги
«Джоэл: и снова о программировании» ISBN 978-5-93286-144-8

VBA Articles · Why do people use VBA?Introduction Recently, I watched a video by YouTuber ThePrimeTime which details a dev’s frustrations with business culture. Prime is an ex-entrepreneur who currently works in software development at Netflix. His views in this video have been criticised for being jaded by FAANG business cultures he has worked in. I personally don’t feel this way. Although there is some truth to the developer’s (mataroa’s) article, I think it misses the root causes of many issues raised. I have mixed feelings about the article in question. Some areas I agreed with and others I disagreed with. However I did want to address one particular concern / statement: I work on a platform that cost my organization an eye-watering sum of money to produce, over the span of two years, and the engineers responsible for it elected to use spreadsheets to control the infrastructure, so we now have a spreadsheet with 400 separate worksheets that powers but one part of this whole shambling mess. I’m speculating here, but I’d imagine that the business/SMEs (Subject Matter Experts) are using VBA to some capacity to control their 400 worksheet collection. So this begs the question… Why do people use VBA? In order to answer this question, we must first look at another question - who actually uses VBA in the first place? In 2021 I ran a poll on /r/vba where I asked redditors why they code in VBA. From these data, we can clearly see that the majority of people who use VBA do so mainly because they have no other choice. Many organisations run their entire business processes with Excel, and when a little bit of automation is required VBA is usually #1 on the list. The versatility of VBA In the business I currently work for, in the engineering division, we have access to a variety of technologies (automation platforms): OnPrem - PowerShell (No access to Install-Module) OnPrem - Excel (VBA / OfficeJS (limited access) / OfficeScripts / PowerQuery) OnPrem - PowerBI Desktop OnPrem - SAP Analysis for Office OnCloud - Power Platform (PowerApps, Power BI, PowerAutomate (non-premium only)) SandboxedServer - ArcGIS (ArcPy) SandboxedServer - MapInfo (MapBasic) SandboxedServer - InfoWorks ICM (Ruby) SandboxedCloud - ArcGIS Online We also have a number of databases controlled by IT: D1. OnPrem - Geospatial database D2. OnCloud - Geospatial mirror D3. OnPrem - SAP database D4. OnCloud - SAP BW4HANA partial mirror D5. OnPrem - Telemetry platform D6. OnPrem - Sharepoint D7. OnCloud - Sharepoint Online D8. OnCloud - EDM Telemetry platform D9. OnCloud - Large mirror database D10. OnPrem - LotusNotes database D11. OnPrem - IBM BPM database D12. OnPrem - File System D13. OnPrem - Hydraulic Model Information D1-D13 databases are summarised in the table below listing what types of data are stored in which systems, the importance of the data stored in each database, and whether the database is essentially a replica of OnPrem information: Data Type D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 Customer Issues X X X X         X         Asset Data X X X X   X X   X     X X Telemetry Data         X     X           Risk Data X X         X     X X   X Financial Data     X X               X   Misc Data X X       X X         X X Note: D6 would be C tier if it weren’t for the fact we continue to store a business critical spreadsheet on Sharepoint OnPrem for compatibility reasons. See the control of VBA for details. And the data’s importance / on cloud replication: Data Type D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 Data Importance S S S S S S/C A B S S S S A Replica of N/A D1 N/A ~D3 N/A N/A N/A N/A ~D4 N/A N/A N/A N/A Note: Online replicas are de facto replicas in terms of data’s importance, although the reason we need to connect to them is diminished Finally, let’s examine how our Automation Platforms link to our Data Platforms. Links shown in the diagram are where the automation platform can access the data from the various data platforms/sources: Note: Some of the links from VBA to OnCloud services are based on my attempts alone. There is no doubt in my mind that VBA can interface with SAP BW4HANA and our other cloud services, I just haven’t figured out the authentication requirements and protocols yet Here’s where you might start to see an issue. Looks like the only automation platforms which can connect to all the data sources we need is VBA and Powershell. Power BI Desktop has been introduced in our business but doesn’t hit all the platforms which VBA does, and even if it did Power BI cannot be used for process automation where-as VBA can, so what’s the point making the switch? Users who do use Power BI to target these other datasets usually generate CSVs of this other data and store these in cloud sharepoint system, but what generates those CSVs? VBA. Now, we’d love to use a higher level language in our organisation to handle this business automation. However, every request for a high level language to be installed across the team/business e.g. Python / Ruby / Node / Rust etc. has been rejected by CyberSecurity in favour of technologies like PowerAutomate, PowerApps which as you can see above barely touch any of the data we need. It is supposedly “Against the technology strategic vision of the company” to allow “end-users” access to high level programming languages. Now even if the data access was there in our business, PowerPlatform would still be insufficient to perform the majority of our processes because the algorithms required are so complex that a PowerAutomate solutions would become infuriating to maintain and incomprehensible to even IT folks (e.g. See projection algorithms). Ultimately the stand-out technologies for us are Powershell v3 (doesn’t even support class syntax and cannot install modules), and VBA, purely from a versatility standpoint. As a result of this ‘monopoly’ on technology I and others have spent hundreds of hours building open source VBA libraries which augment VBA promoting it to a reasonable language by modern standards. The maintenance guarantee of VBA D10 and D11 above are intimately linked. In 2000s many of our systems were built on top of IBM Lotus Notes databases. In 2019 Lotus Notes was acquired by HCL, and since then longevity of support has been wavering. Support will officially die in June 2024. As a result, since 2019, technology teams have been trying to migrate many of our systems to new technologies. The business spent an eye watering amount of money developing a system using IBM Business Process manager to supercede one of these Lotus Notes databases. The anticipation was that D11 would be backfilled with all the data from D10, once fully built, and D10 would be archived. It’s now 2023: We are 8 months away from official support dying. Technology teams have thrown away their support contact for IBM BPM. There is no replacement in sight for both IBM BPM and Lotus Notes databases. IBM BPM solution is poorly maintained IBM BPM solution has numerous issues and doesn’t function as needed Solution has been shoehorned into IBM BPM, despite the platform not being fit for purpose i.e. while IBM BPM does come with a REST API, this REST API is borderline useless to Technology teams and SMEs Some REST calls use javascript encoded as strings Others require html embedded in json embedded in xml Database tables aren’t queried by name but by GUID. There’s no documentation of which GUID relates to which table/process. The data from D10 was never actually transferred to D11, meaning the business is now using 2 systems instead of 1. D11 data model doesn’t really support the data in D10 either. Technology teams appear to be ignoring waning support contracts. This could be due to lack of resources, finances and/or priority. SME’s use these tools on a daily basis, and ultimately it is SME’s who determine changes that need to be made to the system. If SMEs use VBA, they can control and maintain the system as needed. They have a maintenance guarantee, something that should be said for IT systems too, but can’t be. The control of VBA In a recent project we are building a new all encompassing IT system to supercede a business critical spreadsheet. This would ultimately demote D6 to C tier importance. The spec for this system was initially simple - Give us a NodeJS server with a MySQL database. Use React for the UI. Give admins/SMEs (subject matter experts) access to the codebase with access to git for code control. IT and SMEs will collaborate to build the system. Technology teams demanded that admins/SMEs will not have access to the code. Technology teams demanded that FrontEnd be built in Microsoft PowerApps, to comply with “Strategic Vision”. Technology teams demanded that BackEnd be built in Microsoft Azure Pipelines, to comply with “Strategic Vision”. Unfortunately, as an admin/SME with more development knowledge than many people in technology, these demands do not sit well with me: Technology teams do not understand work in the teams thus do not understand business logic and calculations Thus devs writing business logic is error prone. Technology teams has frequently abandoned bespoke technology projects, leaving no resource to maintain and improve the system. Collaboration with SMEs will ensure that at least 1 team maintains resource to maintain system. SMEs need to ensure that they have confidence in what is produced. How, without observing that the code doesn’t work for all edge cases? Unit tests? Perhaps, but without seeing the code how can we verify these unit tests exist? And are ran frequently*. SMEs improve and maintain the existing legacy system, and have unparalleled knowledge of how systems interact. Less knowledge can be shared in upskilling Technology teams where it is required. SMEs need to ensure all data is transferred and represented correctly in new system. SMEs unable to do this without backend access. Ultimately, as long as code stays in VBA it is controlled by the SMEs and the business. Technology teams rarely relinquish control to business teams. SMEs can ensure that software is developed properly in a modular fashion and doesn’t end up as a cluster of barely working technologies loosely linked together. The UX of VBA This is a smaller one, because you can always make familiar feeling tools in any language, but there is something to be said about the fact that most engineers use spreadsheets in their day job, and how VBA is embedded within these spreadsheets and can improve on UX. Giving someone a foreign tool in a familiar environment, is often much more powerful to that user, than a foreign tool in a foreign environment. Conclusion In conclusion, yes, we (and many others in businesses) do choose to use spreadsheets (and VBA) for many tasks within our organisations, there are many reasons for this, including: Poor alternatives provided by IT due to security concerns. Poor connectivity of alternatives to source systems, usually because they are still WIP. Faults in IT strategy which don’t account for certain use-cases. Unwillingness to collaborate with SMEs due to security and maintenance concerns. Lack of training for users/managers/SMEs in alternative systems. Users/SMEs wanting some level of control over the business logic in these systems. It’s the only viable technology which is available to everyone, as it’s part of Office. This does not mean that we are at all blind to VBA’s weaknesses though: Why is VBA most dreaded? What is wrong with VBA? There’s no doubt in my mind that there are some elements of truth to mataroa’s article. Sometimes management is poor, but more often than not I believe most people in organisations are trying to do the right thing, and are doing whatever they can with the tools that are available to them.

I had completely forgotten how unpleasant the entire Excel VBA experience is.

- Coding without useful code completion. Kill me now.
- I accidentally made an infinite loop. I had to power-cycle my machine it wedged so hard!
- That "special" VB syntax. "loop? wend? end? who knows!"

paste.erratic.cloud/?114ae5be9

I am so grateful that this isn't something I routinely have to touch!

Hi, I’m James and this is my #introduction.

I'm originally from a rural town in middle Missouri but now call #SaintLouis my home. I have a love for the American southwest (my Mom is from New Mexico) and for the coastal city of #Savannah #Georgia.

I'm single, live alone with two #dachshunds (#dogs) named Amelia and Penelope. I'm a #progressive #liberal, can't stand money in #politics, and yearn for a day when the #Democrats improve their messaging and start fighting back.

What I'm into: #Photography, #Cooking, #Grilling, #StarWars, #StarTrek, #80sMovies, #JurassicPark, #Marvel, #dinosaurs, #computers, #gadgets, #VBA, #Python, #MSExcel, #art, #archaeology, #history, #3DPrinting, #philosophy, #news, and you'll find I'm a bit of an all-around nerd.

I’m also #diabetic, suffer from #anxiety, #depression, and #panicattacks. Forgive me in advance if I reach out.

I'm sarcastic as all get out but I have a big heart, that's easily broken when I see people (or animals) hurting.

Cybercrime e Phishing: componenti XLL di Excel come vettore iniziale di attacco

Gli analisti di #CiscoTalos affermano che dopo che #Microsoft ha iniziato a bloccare le #macro #VBA nei documenti Office scaricati da Internet, tali documenti (contrassegnati come Mark Of The Web) hanno costretto gli #aggressori a ripensare le loro catene di #attacco.

Ad esempio, i criminali informatii utilizzano sempre più i file dei componenti aggiuntivi di #Excel (.#XLL) come vettore di #compromissione iniziale.

#redhotcyber #informationsecurity #ethicalhacking #dataprotection #hacking #cybersecurity #cybercrime #cybersecurityawareness #cybersecuritytraining #cybersecuritynews #privacy #infosecurity

lnkd.in/d_ghTBKj