Code Monkey home page Code Monkey logo

appexportjson's Introduction

[Excel VBA] appExportJson : Excelで作成したデータをJSON形式でExportするツール

overveiw :

  • 指定の形式で作成した、Excelファイルを、JSON形式に変換し、出力する。
    • 対象の形式
      • Key-Value形式
      • ListObject形式 (TBL形式)
      • Named Range形式

機能 :

  • Excelにて、指定の形式で、データ表を作成し、指定フォルダ(input folder)に配置する。
    • 指定の形式は、下記にて説明。
  • メニューより、以下の機能を利用する。
    • Export JSON (Key Value Sheet)
    • Export JSON (ListObject:TBL)
    • Export JSON (Named Ranges)

実行環境 :

  • Microsoft Excel for Microsoft 365 MSO (16.0.13001.20142) 32-bit

Installation :

image

Usage :

  • アプリは以下。

    • アプリ本体 :appExportJson.xlsm
      • Batch : ExportJsonMain.bas
        • ExportJsonModule.bas
          • GetKeyValue
          • GetTable
          • GetNames
    • アプリconfig:config.json
  • appExportJson.xlsmを開く。

menu

初期コンフィグ設定 :

{
    "BASE_FOLDER": "",
    "INPUT_FOLDER": "input",
    "OUTPUT_FOLDER": "output",
    "TEMP_FOLDER": "input/temp",
    "BACKUP_FOLDER": "input/backup",
    "FORM_FOLDER": "forms",
    "TRANSFORM_KEYVALUE": {
        "SHEET_TYPE": "KEYVALUE",
        "INPUT_LIKE": "KV*.xlsx",
        "TARGET_WORD": "no",
        "MACRO_GET_METHOD": "GetKeyValue"
    },
    "TRANSFORM_LISTOBJECT": {
        "SHEET_TYPE": "LISTOBJECT",
        "INPUT_LIKE": "TBL*.xlsx",
        "TARGET_INDEX": 1,
        "MACRO_GET_METHOD": "GetTable"
    },
    "TRANSFORM_NAMES": {
        "SHEET_TYPE": "NAMES",
        "INPUT_LIKE": "ApplicationForm*.xlsx",
        "TARGET_PARAM": "A1",
        "MACRO_GET_METHOD": "GetNames",
        "DETAIL_FIELD": "definition"
    },
    "CONTROL_PREFIX": "__",
    "SOURCE_FROM": "_source",
    "APP_NAME" : "appExportJson"
}

Environment :

env

Execution sample :

Key Value Format

keyval

ListObject(TBL) Format

tbl

named

Named Range Format

namedrange

named

application I/F :

'''' **********************************************
'' @file ExportJsonMain.bas
'' @parent appExportJson.xlsm
''

Public Sub Batch(ByVal datatype As String, Optional ByVal moveOn As Variant = False)
'''' **********************************************
'''' @function batch
'''' @param datatype {String} processing data type
''''        dictionary key in config.json
''''          "TRANSFORM_KEYVALUE" : key value formatted sheet
''''          "TRANSFORM_LISTOBJECT" : Tbl sheet
''''          "TRANSFORM_NAMES" : Named range sheet
'''' @param moveOn  {Variant<boolean>}
''''            a flag ot moving input files
''

note :

  • 落ち着いたら、もう少し記述を追加します。

reference :

// --- end of README.md

appexportjson's People

Contributors

sakai-memoru avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.