1

Here is a code snippet:

' Send the query in the body to Jira, and get the response from Jira

strJsonResponse = Utilities.JiraRequest(strJQLQuery)

I'd like to put this json into a Python parser and then return the parsed json back into the spreadsheet. Is this possible? I've never worked with VBA before.

I have downloaded the JIRA API module and the openpyxl module.

Knowledge Cube
  • 990
  • 12
  • 35
jenkelblankel
  • 155
  • 2
  • 15

2 Answers2

1

You might be able to create a new text file and output VBA to that

Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim Fileout As Object
Set Fileout = fso.CreateTextFile("C:\your_path\vba.txt", True, True)
Fileout.Write strJsonResponse
Fileout.Close

VBA code found here

then have VBA start up your python script where you can have python parse your file. There is probably a better way to do this but I'm not sure what.

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
BobserLuck
  • 401
  • 1
  • 3
  • 13
0

I think that Tehscript raised a valid question. Are you certain that there's a need to use VBA code in addition to your Python code? By running Python code that makes use of the openpyxl module you can read out and modify basically everything that's in an Excel file, completely without the need to run an Excel application.

Sometimes there are valid reasons for coupling VBA and Python code. The most common one is when you want to use Excel as a familiar graphical user interface to direct data manipulation operations, but want Python to do the actual heavy-lifting. If you're looking to do this, then there's the xlwings module. Xlwings makes it easy to call Python code from inside VBA modules, and to exchange data values between VBA and Python.

Xukrao
  • 8,003
  • 5
  • 26
  • 52