Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

284
Visualizações
Is it possible to use Javascript to automate Excel without hosting an add-in?

I've been using VBA to automate Excel for a few years. Lately I've been having trouble sharing my macro-enabled workbooks with colleagues. Sometimes their virus-protection software deletes the files and I've even had gmail strip them out of my emails.

I've heard of Office-JS and using JavaScript to make add-ins, but this seems like too much overhead. I don't want to build and host an add-in, I just want to be able to effectively share my work in automating Excel with colleagues, both in my company (a university) and out.

I've thought about sharing the VBA code separately from the workbooks, but some of the people I'm working with are not the kind that can effective import code and forms etc.

Is there any advice for how I might be able to automate Excel without the headaches of hosting an add-in or working with macro-enabled workbooks?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

No, it is not possible to automate Excel in-proc. And I'll explain why... You can use any script languages like JavaScript from Internet Explorer to automate Excel (out-of-proc), but most of web browsers (where your script code can be run) are not aware of COM servers and this technology in general. So, it doesn't make any sense.

Office Web add-ins are multiplatform which means the code can be run from a web browser (O365) or Office desktop clients and etc. You have been given a valid advice - to develop an extension which can be deployed separately, you just need to transfer the workbook without any code.

You may also consider developing a VSTO based add-in - it can be a document-level or application-level add-in. In that case you need to create a separate add-in's installer. Web add-ins simplify deployments of your Office solutions a lot.

You may also think of Office Scripts. They are designed for secure, cloud-based solutions. But, currently, Office Scripts are only supported in Excel on the web. Read more about them in the Differences between Office Scripts and VBA macros article.

Finally, consider uploading your workbooks to a shared folder on any file server such GDrive or OneDrive and send a link instead. Hope it makes sense.

about 4 years ago · Juan Pablo Isaza Relatório

0

JScript can and it's built in to Windows. VBScript can too and is also built in. Any COM programming language can control COM servers like Word etc.

One important thing to note for VBScript. When external programs run using late binding there is no access to constants. You enter the numeric value of the constant. EG you use 5 not wdBold. You look it up in Excel's Object Browser (press F2 in VBA editor).

Set myExcel = CreateObject("Excel.Application")
Msgbox myExcel.name

If you have excel installed copy lines above into a file called myscript.vbs. If not just type in it msgbox "hello world". Windows comes with the following languages built in. VBScript, JScript, It also come with compilers for JScript.Net, VB.NET, C# (see C:\Windows\Microsoft.NET\Framework\v4.0.30319 and jsc.exe, csc.exe, and vbc.exe). All can access COM automation. Windows Scripting Host runs VBScript/JScript outside of a browser - type in command prompt wscript /?.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda