VBA에서 Google 스크립트로 변경 : From VBA to Google Apps Script

From VBA to Google Apps Script

 

Some notes on this section

I wrote this entire section on VBA to Apps Script transition quite some time ago, and of course some things have changed since then in the fast moving world of Apps Script. My new book is all about this subject and contains brand new information, especially if you are interested in VBA to Apps Script migration.  You'll also find some adapted material from the book here.
 

What is Google Apps Script

VBA is to Office as Google Apps Script is to Google Apps. Those tasks to automate repetitive sequences, or  extend the functionality of Office can usually be done in Google Apps Script. Not only that, but since it is really just javaScript, you could either know the basics already, or by learning it, you will be able to write regular web applications as well as to extend Google Apps. Google Apps Scripts 'live in the cloud' and form part of the tool set available to make your Google apps experience more fulfilling.

Transitioning from VBA

These following article set will take you through an accelerated program to learn javaScript and Google Apps Script with an emphasis on how to use it to do things you already know how to do in VBA, by showing you how it's done in each language. 
 
First observation - it's painfully slow compared to the same thing in VBA, but see Optimizing access to sheet values. This a feature rich caching capability, both read and write, and applying to all range methods that have both a set... and get... version.
 
 

Running Apps Script from VBA

This is often a good way of migrating a step at a time. Take a look at Integrating VBA and Javascript and this blogpost to see more on this approach

Abstraction

I have talked about data abstraction extensively on this site, meaning separating the physical data location from the data itself so that procedures are not aware of where the data is coming from, or even that it originated in Excel. This approach will serve us well, since it means that if we simply change the Data Manipulation Classes to understand about the Google Apps Data structures, the bulk of the logic will remain intact, even if they do have to be translated. 
 
If a regular visitor to this site or the associated blog, you will know that many main functions are executed in one or a just a few lines of code, and generally speaking these avoid addressing specific Excel capabilities through data abstraction. Once the underlying libraries and classes are ported to Google Apps, it will be a simple job to port most of the Excel procedures on this site.

 

Things we need to get started

  1. Getting started
    1. Learning javaScript
    2. classes and javaScript
    3. javaScript functions
    4. Apps Script versus VBA scope
    5. Gapps Conversion approach
    6. Some Google Apps Scripts gotchas
    7. Managing shared libraries with Google Apps Script
    8. Automatic VBA to GAS skeleton
  2. Useful hacks
    1. Dealing with optional arguments
    2. VBA collection in javaScript
    3. VBA debug object
    4. Optimizing access to sheet values
    5. What to use in place of Excel Shapes
    6. How to make charts in Google Apps Script
    7. Apps Script timer collection
    8. GAS hacks for VBA
    9. Using scriptDB
    10. Tracking activity with ScriptDB
    11. Generate an auto incrementing key with scriptDB
  3. Some Excel library conversions
    1. Data manipulation Classes in Google Apps Script
    2. Color Ramp useful scripts
    3. cJobject Class in Google Apps Script
    4. Scraperwiki data to Google Docs
    5. Playing around with GAS color
    6. Color space conversions in GAS
    7. Color Matching in GAS
  4. Leaving VBA behind
    1. A simple Google Apps Script RestQuery
    2. Apps Script custom functions
    3. Looping in Google Apps Script
    4. Advanced Array functions
  5. Performance blog posts
    1. New sheets for old - writing comparison with new,old and excel
    2. Execution time woes

Project conversion

  1. Roadmapper migration. We will use the Roadmap Generation project as a model for learning how to take an existing, complex project and convert it from VBA to Google Apps Script.  
  2. Google Script Color Ramp . A conversion from the VBA Color ramp library
  3. GAS Rest Library migration. A conversion from the VBA Rest to Excel library

Power of apps script

VBA is often not given the credit it deserves as a very well integrated and capable language, with plenty of bundled capability to reach into the object model of Office - but it's not really going anywhere. Although you can't believe everything you read, you can see where even Microsoft are going with HTML5 and javaScript versus VBA
 
The Google Apps API is very powerful, and is evolving very quickly. Expect to see continued added functionality.
 

Some slides with a sample of VBA function translated to Google Apps Script

 
 


 For more like this, see  From VBA to Google Apps Script . Why not join our forum,follow the blog or follow me on twitter to ensure you get updates when they are available. Much of  the code referred to here is the mcpher library. You can find out how to include it in your project here

 

[출처] http://ramblings.mcpher.com/Home/excelquirks/gooscript

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

 

 

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
738 도스 허큘리스 모드에서의 GW-BASIC 그래픽 프로그래밍 file 졸리운_곰 2018.12.04 573
737 <도스박스 사용법> dosbox.conf - [dosbox] (도스박스 한글화, 그래픽 카드, 램 용량 등) file 졸리운_곰 2018.12.04 434
736 2019년도 국가기술자격검정 시행공고 file 졸리운_곰 2018.12.02 109
735 DOS 게임을 telnet (ssh) 방식으로 접속 : Creating a DOS Games Server 졸리운_곰 2018.12.02 93
734 웹 브라우저에서 윈도우 95 구동하기 file 졸리운_곰 2018.12.01 100
733 피벗 테이블 file 졸리운_곰 2018.11.30 91
732 142_엑셀 피벗테이블 만들기 (2) file 졸리운_곰 2018.11.30 87
731 141_초급 강좌 – 피벗 테이블 기본(1) file 졸리운_곰 2018.11.30 76
730 Visual Studio Code 파이썬 개발환경 구축 file 졸리운_곰 2018.11.29 87
729 하이퍼레저 페브릭에 대하여 잠깐 알아보자 [펌] file 졸리운_곰 2018.11.27 105
» VBA에서 Google 스크립트로 변경 : From VBA to Google Apps Script 졸리운_곰 2018.11.27 96
727 vba 에서 gas (google apps script)로 변환 Simplifying Migration from VBA to Google Apps Script 졸리운_곰 2018.11.27 151
726 엑셀 숫자 연속 번호 매기기 방법! file 졸리운_곰 2018.11.04 86
725 “정말 아무것도 모르는” 엑셀 초보자를 위한 핵심 키보드 단축키 15개 file 졸리운_곰 2018.11.04 304
724 수학 / 수치해석 라이브러리 모음 졸리운_곰 2018.11.04 148
723 구글이 만든 Docker Container Orchestration 툴, Kubernetes 소개 file 졸리운_곰 2018.11.03 98
722 GPL·AGPL·MPL…한눈에 보는 오픈소스SW 라이선스 file 졸리운_곰 2018.10.31 112
721 리모릭스 개발 이야기 (Xamarin 응용개발기 프로젝트) file 졸리운_곰 2018.10.17 130
720 How to fix GC overhead limit exceeded in Eclipse file 졸리운_곰 2018.10.16 93
719 마이크로 서비스 아키텍처 file 졸리운_곰 2018.09.07 94
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED