Excel Macros with JavaScript & Node JS - Read Excel File to JSON, Modify & Write Back to Excel

Поділитися
Вставка
  • Опубліковано 23 січ 2025

КОМЕНТАРІ • 165

  • @DanhWasHere
    @DanhWasHere 5 років тому +15

    Great tutorial! Btw 5:56 is when he starts coding the script if you are already familiar with Node workflow.

    • @OrbitTurner
      @OrbitTurner 2 роки тому +1

      Thanks a lot ! I was fast forwarding the thing until i seen this !

  • @nickersonlauriston1582
    @nickersonlauriston1582 2 роки тому +1

    This video was AWESOME!!!!! I learned sooo much from the video than from hours of reading documentation. Thanks!

  • @reallyefficient
    @reallyefficient 4 роки тому

    I've loved your channel for the last year - you are such a breath of fresh air. I may not understand a LICK of what you are doing but you make it seem so effortless. Thank you for your videos!

  • @blessinagolle1473
    @blessinagolle1473 2 роки тому +1

    saved me..tq🙂Hoping for more vedios

  • @keithpowell8123
    @keithpowell8123 2 роки тому +3

    Great video! Clear and concise - the best one I've found on this topic! I am going to check out your other automation tutorials.

  • @JuanMartinRuiz
    @JuanMartinRuiz 4 роки тому +3

    Thank you for this video, it helps me to apply it with test driven with selenium. Greetings from Buenos Aires, Argentina

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      You should check this out ua-cam.com/play/PLRmEk9smitaXljDN2CjwZ96o4Aj87iuC5.html

  • @animeshkr29
    @animeshkr29 3 роки тому +1

    Each and every step is from the scratch ,thanks a lot

  • @hengkilodwig
    @hengkilodwig 2 роки тому

    Hi , Can you show me if in the cell have a data validation? how you read data validation and make the new sheet with the same data validation?

  • @onderyurdaer
    @onderyurdaer Рік тому

    Very nice, easy and understandable explanation, smooth and simple program compilation. Thanks

  • @dokedoke0426
    @dokedoke0426 2 роки тому

    Man, I am a fulltime student but part time working as a data entry and the work I have to do weighs nearly a million data and it lags every time I run that shit excel file until I found this Video!!!
    I learnt frontend web dev and a little about node js. And boom! I found this video and now I can just spend too little time on my shitty work and focus on my real career improvement!
    Thank you brother!

  • @bhaskarroy3364
    @bhaskarroy3364 2 роки тому

    10:30 I cannot proceed as my var ws = wb.Sheets("Sheet Name"); returns an error called Sheets is not a function. I searched online but no specific help on the same.

    • @bhaskarroy3364
      @bhaskarroy3364 2 роки тому

      Edit: Just found out online that as it is an array, I have to write it as ["Sheet Name"].

  • @armandocontreras8563
    @armandocontreras8563 3 роки тому +1

    fabulous very well explained stip by stip, just what I was looking for

  • @ameensams
    @ameensams 4 роки тому +3

    Wow wow, for a non-pro coder "yet" this is the first video on youtube that made me feel coding isn't only an endeavour of the genius. BTW do you have a course on udemy? Thanks for your insight, this opens up another level of understanding for me. What you did here, I usually do using macros on excel.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      No udemy courses, but maybe check out my advanced channel if you are interested in more programming videos ua-cam.com/channels/JebzvfCuA5ymtb79DQm36A.html

  • @lorenzobandinelli2638
    @lorenzobandinelli2638 3 роки тому

    in 18:26, when he's writing that function, where does that "record" inside the callback function come from? or is it just a name to refer to itself?

  • @sabrinamckinney512
    @sabrinamckinney512 3 роки тому

    super helpful for new programmers and out of season. thanks so much for posting this video.

  • @sephiroLord
    @sephiroLord 9 місяців тому

    Question for you, is it possible to have a workbook as an API source that people with access can retrieve data from it with the right commands? if so is there a tutorial on how to go about it?

  • @juliusdx
    @juliusdx 3 роки тому

    Hi for some reason my output file data appears in a different column to the original file? i.e. data in column A in original file appears in column D in the output file.. any ideas??

  • @negociosonline40
    @negociosonline40 3 роки тому

    how do i import data from excel and add it to a node.js file?

  • @drekforder2952
    @drekforder2952 3 роки тому

    is there a way to get value of a certain cell, like I want a value just of a let's say A1 cell. how whould I do that?

  • @massamsss
    @massamsss 5 років тому +4

    Thank you very much, the explanation is very clear. it really help me a lot .

  • @minhazahmed128
    @minhazahmed128 2 роки тому

    How would I keep the design (styles) of the xlsx file?

  • @iand954
    @iand954 Рік тому

    Thank You! One question: is it possible to keep style of 1st file during modifying? I mean cells: background color, width, borders and ect

  • @MrXuFan
    @MrXuFan 4 роки тому +1

    Awesome video! Very practical.

  • @gastondev4919
    @gastondev4919 4 роки тому +1

    Very useful, super clear explanation and easy to learn, thank you!

  • @vamsikonduru4841
    @vamsikonduru4841 3 роки тому +1

    thanqq very much dude u saved my job

  • @h.h3296
    @h.h3296 5 років тому +1

    so useful, straight to the point! thanks

  • @Orafasb
    @Orafasb 4 роки тому +1

    Thanks dude! This great video helped so much!

  • @rajat420420
    @rajat420420 2 роки тому

    Hi, how can I delete the worksheet? I can't see any method can u help me

  • @SarthakKumar
    @SarthakKumar 2 роки тому

    Hi, i just had one question, can we do the changes in the same worksheet itself without creating a new one??

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 роки тому

      Not with this library. To make changes in the same file you'll need Windows with Excel installed and basically hook into VBA code though Python to make changes to the file and save.
      If you are 365 Business user you may want to look into Excel Automate ua-cam.com/video/Yso6-jWFATo/v-deo.html

  • @mohammadalmokdad1309
    @mohammadalmokdad1309 3 роки тому +1

    Thank you so much, this was really helpful !

  • @sahoo.subrat
    @sahoo.subrat 3 роки тому

    How to detect duplicate cells in a sheet and merge those duplicate cells only

  • @edjaeger356
    @edjaeger356 2 роки тому

    Well done and super useful. Thanks! Are you planning on creating a series about using Excel Javascript API?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 роки тому +1

      Will be doing videos about Excel online scripts, which is based on Javascript API.

  • @mohamedkhalilarfaoui5682
    @mohamedkhalilarfaoui5682 2 роки тому

    thank you , Great video , super helpful , Very practical

  • @hablu
    @hablu 4 роки тому

    How to handle End of data reached error in xlsx or excel js

  • @jaiviksoftweb1863
    @jaiviksoftweb1863 2 роки тому

    How to Append data in same sheet "New Data"? For Ex. insert anything in same sheet. (My error : New Data already exist.)

  • @Akash-sq2cs
    @Akash-sq2cs 2 роки тому

    sir , how to use json_to_sheet in apps script

  • @granand
    @granand 3 роки тому

    Can I do everything that VBA does in JS and Node JS as excel plans to move to this?

  • @paarthsoin3615
    @paarthsoin3615 4 роки тому

    what if instead of simple key pair data is in form of key: array of objects

  • @ΒασίληςΖ-σ4υ
    @ΒασίληςΖ-σ4υ 3 роки тому

    Very nice video my friend. Thanks.

  • @guilhermexavier2803
    @guilhermexavier2803 3 роки тому

    Awesome video! Thanks

  • @nasirahmad4324
    @nasirahmad4324 4 роки тому

    Can you please tell me how to read from that sheets and write it into a google doc

  • @la_pulga8224
    @la_pulga8224 Рік тому

    how can I delete a row from an excel file

  • @vaulinaapriyani1573
    @vaulinaapriyani1573 3 роки тому

    Hi, thank you before with this video.
    I got problem when view terminal is showing Windows PowerShell, not xlsx-node adm$
    I already install nodejs.
    Can please help me? Thank you

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому

      Check my other channel for help with nodejs and vscode installation ua-cam.com/channels/JebzvfCuA5ymtb79DQm36A.html

  • @gabrielbatista3676
    @gabrielbatista3676 3 роки тому +1

    Just saved me. Thank you!!

  • @abdullahalmanasseer4360
    @abdullahalmanasseer4360 2 роки тому

    How do i reference this array in html, i wanna create a table from that array

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 роки тому

      Depends on what you use for your server back-end and front-end.

  • @niteshkedia
    @niteshkedia 5 років тому +1

    can we do the same for .xslm in node.js

  • @omnarayan7066
    @omnarayan7066 4 роки тому +1

    Really good for me Thank you Sir.

  • @ahmedchouihi
    @ahmedchouihi 4 роки тому

    Is there any file with dummy data excel

  • @rogerccaqp
    @rogerccaqp 3 роки тому

    i want this for m.s Word docs.
    modify then and keep the format file.
    not matter if create a new file.

  • @starktv8646
    @starktv8646 2 роки тому

    It was a great video, but how can I save the file as json ?

  • @tiwarirr
    @tiwarirr 5 років тому

    Very good Video Sir. I am Waiting for more!

  • @shriniwasbhardwaz2949
    @shriniwasbhardwaz2949 3 роки тому

    Hey if we are adding a link to Excell file on OneDrive in xlsx.readFile(" ")

  • @mitulvaghela906
    @mitulvaghela906 4 роки тому

    Crisp and concise!!

  • @baluprasad3794
    @baluprasad3794 4 роки тому

    Hi Please help on how to update particular cell value using node js and java script

  • @televisedfeedback6660
    @televisedfeedback6660 2 роки тому

    With the map function you set, record.Sales - record.Cost, how could it be rewritten so that it's record.Sales - record.Sales from a different row? I've used some of this coding and I'm trying to automate measuring change over time. Thank you for your time. :)

  • @TheEnzoachi
    @TheEnzoachi 2 роки тому

    Great video sir. Thanks a lot

  • @anudeepsyamprasad6586
    @anudeepsyamprasad6586 5 років тому

    Thank you so much for your time and effort. Explained so neatly..

  • @akshitha2110
    @akshitha2110 4 роки тому +1

    This is such an amazing video. Really Helpful. How can we access a particular range of cells and how can we give name of the keys instead of taking the first row? Can anyone help on this?

  • @sreekanthreddy1976
    @sreekanthreddy1976 3 роки тому

    What should be the correct way to add a new column with data and write to the existing XLS sheet rather than write and generate a new file?

  • @ace.mccloud5425
    @ace.mccloud5425 4 роки тому

    Are you using any extension to open "Excel" files in Visual Studio Code?

  • @muthunatarajan4498
    @muthunatarajan4498 5 місяців тому

    Neat and simple. It works perfectly fine from Terminal. But how do I call this from an HTML file? Thanks a lot

  • @easy-draw
    @easy-draw 4 роки тому

    Great video . I have question how do you target all sheets in excel file instead of one.

  • @fullStackInKannada
    @fullStackInKannada 5 років тому +2

    Thank you for this video, it really helped me a lot :)

  • @ajayzz8175
    @ajayzz8175 4 роки тому

    A great video indeed 🙌🏻

  • @Oscarda016
    @Oscarda016 3 роки тому

    anyone else having issues with node script.js?
    what i keep getting
    ReferenceError: readFile is not defined

  • @ahmedchouihi
    @ahmedchouihi 4 роки тому

    Is there any tutorial with CRUD and angular included

  • @nicolecaday1201
    @nicolecaday1201 4 роки тому

    im using windows and it's showing me cmd in the terminal. Whats the cmb keywords for it?

  • @rohitvishwakarma9261
    @rohitvishwakarma9261 Рік тому

    what about macros ?

  • @GuilhermeHenrique-vo1sk
    @GuilhermeHenrique-vo1sk 3 роки тому

    Great tutorial !

  • @chengqinglow4034
    @chengqinglow4034 3 роки тому +1

    Thank you!

  • @vincerolf1
    @vincerolf1 5 років тому

    Thans too for this clear explaination to a from z. It help me. You should continue to make some short exemple of what it is possible to do and usually used in buisness.

  • @amritgupta1540
    @amritgupta1540 5 років тому

    if you want to read data from specific row then what should we do?

  • @naveenr9563
    @naveenr9563 4 роки тому

    Hi really a nice video, here's a question how do I append data to the same excel file by adding another column rather than creating new excel file. Could you please help me

  • @muzamilhussain2550
    @muzamilhussain2550 4 роки тому

    Please explain how we can read multiple worksheets from one excel file

  • @BlackZero880
    @BlackZero880 3 роки тому

    this was the easy peazy method ever on xlsx

  • @juanpablovelandia8930
    @juanpablovelandia8930 4 роки тому

    thank crack , greeting from Colombia

  • @frankmyatthu2406
    @frankmyatthu2406 3 роки тому

    Great job, let me also know how we can create customized function so that excel can call like formula

  • @JM-un9xn
    @JM-un9xn 2 роки тому

    How the hell can you guys read cells that are (sum()..). I'm using the library, it simply ignores it.

  • @manuelcasares7270
    @manuelcasares7270 3 роки тому +1

    Thank you so much!!

  • @kevincamarillo1152
    @kevincamarillo1152 4 роки тому

    How can I start reading from a specific row? 🙏🏼

  • @crypto4ever525
    @crypto4ever525 3 роки тому

    Thanks a lot for this beautiful video!! i am streaming data from an api (server side) and like to convert the live json data in to excel file, so i can see the data updated every 3 seconds. (already have refreshed data in my node console) can you please advice me how to do it? thanks a lot for any help with this one :-)

  • @mc-ti5uq
    @mc-ti5uq 5 років тому

    awesome explanation... great video... thank you very much :)

  • @mikexue5104
    @mikexue5104 4 роки тому +1

    is there any free package similar to sheetjs?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      xlsx is another one. sheetjs isn't working our for you?

    • @mikexue5104
      @mikexue5104 4 роки тому

      @@ExcelGoogleSheets yeah, it worked, but I have not read through license term, in case I need to use it in future commercial product…

  • @sciences-sci
    @sciences-sci 2 роки тому

    Excellent merci pour ce tuto

  • @akashilanthendral9958
    @akashilanthendral9958 3 роки тому

    In my case, when I tried to execute
    "var data = xlsx.utils.sheet_to_json(ws);"
    "console.log(data);"
    I got an error.
    TypeError: Cannot read property 'length' of undefined
    could someone help me resolve this error?

  • @K3N_L33
    @K3N_L33 5 років тому

    is this can be applicable to any excel file type? like csv/xls ??

  • @muzamilhussain2550
    @muzamilhussain2550 4 роки тому

    Hey bro, your video is awesome. I have one question. If we don't create a new file and add a new row to an existing file and saved data in this file. how can we do this?

  • @jameskalenga7546
    @jameskalenga7546 2 роки тому

    Thanks a lot for sharing

  • @AyushSharma-iw9do
    @AyushSharma-iw9do 4 роки тому

    Thanks for the video, but this map() function is through exception in angular as "data.map is not a function", pls suggest!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      has nothing to do with angular. that usually means that data at that point was not populated with an array.

  • @bhattaraitheaxe
    @bhattaraitheaxe 3 роки тому

    Awesome ❤️

  • @cedrio1027
    @cedrio1027 5 років тому

    thx man this helped very much

  • @therealprince777
    @therealprince777 5 років тому

    Is node a dependency here if I create a web app and want to use on a different PC?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  5 років тому

      If you use node then yes. You'll have to install node on the other PC as well to be able to run the same script. You can use things like electronjs or something similar to build an app out of it that will run platform independent.

  • @neoocm
    @neoocm 6 місяців тому

    There is no macro in the excel file

  • @click2gopal
    @click2gopal 4 роки тому

    Thanks for the video.

  • @sanjayeshwar6904
    @sanjayeshwar6904 4 роки тому

    Thanks for this video.. it's really very helpful.. one thing, can we display what's there in consol into the web? And is it possible to display a perticular row instead of displaying hole table? Please can u help with this.. this will help me with my project.

    • @DavidMartin-iq9ix
      @DavidMartin-iq9ix 3 роки тому

      You can send the data to your front end using JSON.parse(data, null, 2) and display it inside of a pre tag. To display a single row you would just return the index of the object/row you're trying to render

  • @josericardo3015
    @josericardo3015 4 роки тому

    Tks for the video!
    Have you got any video with instructions to get the content (data) from one excelonline workbook, located in onedrive and push this data to a googlesheet?
    Let me know!
    Ps: As that excel workbook in onedrive is always refreshed, the idea is to have the googlesheet updated.
    👍

  • @reynaldonovard718
    @reynaldonovard718 3 роки тому

    it's great tutorial, i try to call it using VBA Shell, but it doesn't work, its just blink without any output. Can u help me? Thankyou

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому

      start by including the full path to the script.
      Instead of
      node main.js
      Use
      node "C\:folder\folder\main.js"
      depending on your environment you may even need the full path to node

    • @reynaldonovard718
      @reynaldonovard718 2 роки тому

      @@ExcelGoogleSheets i deploy main.js into exe file and try execute that file using excel VBA Shell. Its just blink without any output, but if i double click thats file its can run perfectly, the problem just if i try to execute using VBA Shell. Please help meee :(, Thankyou

    • @reynaldonovard718
      @reynaldonovard718 2 роки тому

      ​@@ExcelGoogleSheets​
      when i try with command prompt :
      D:\PPIC\PROJECT-PPIC>sheets-api-project\main-win
      Connected!
      C:\snapshot\sheets-api-project
      ode_modules\exceljs\lib\xlsx\xlsx.js:51
      throw new Error(`File not found:
      ^
      ${filename}`);

      Error: File not found: Test API.xlsm
      at XLSX.readFile (C:\snapshot\sheets-api- project
      ode_modules\exceljs\lib\xlsx\xlsx.js:51:13)
      at async gsrun (C:\snapshot\sheets-api-project\main.js)

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 роки тому

      Sounds like when you created your executable, it didn't bundle modules in it, it's still trying to find modules folder and it fails to find at in that location.
      If you only run this script on this machine, just run the node script in the shell and don't worry about the executable.
      Otherwise I would rebundle it the right way.

    • @reynaldonovard718
      @reynaldonovard718 2 роки тому

      @@ExcelGoogleSheets Thankyou very much

  • @siddisking
    @siddisking 5 років тому

    How to send this file to client without saving it ?

  • @lestermaravilla2767
    @lestermaravilla2767 4 роки тому

    sir, can you give an example about this? by browsing or uploading a file?

  • @monalishaswain9932
    @monalishaswain9932 5 років тому

    thankew so much ...i's actuALLY HELPFULL