Latest Questions tagged Vba

Browse all latest questions tagged Vba

34
Votes
Published 30 Oct, 2022
Java - Generate a excel using java and create a macro in the excel

I have a java code that takes data from MongoDB and later creates an excel(.xls) containing this data using Apache POI but in a formatted manner. My final requirement is to mail the last worksheet i...

32
Votes
Published 06 Aug, 2022
Python - xlwings for Excel for Mac 2016

I am using mac OS X Sierra with Mac for Ecel 2016 and python 3.6. I am trying to launch a python script from excel because: I already have an excel with a lot of functionalities and I would like to...

45
Votes
Published 26 Apr, 2022
Python - How to call python script on excel vba?

Trying to call a python script on Vba and I am a newb. I tried converting the main script to an exe using py2exe and then calling it from VBA (shell) but the main script calls other scripts therefore...

48
Votes
Published 21 Aug, 2022
Python - How can I search the Outlook (2010) Global Address List for a name?

I have a list of names, some of them complete, some truncated. I would like to search the Outlook address list for matches for these names. The closest I have come is this Python code which came from...

25
Votes
Published 12 Aug, 2022
Python - pyvot: can I run Excel VBA macros from python script?

Say I have loaded Report WW26blueprint_with_chart_330.xlsm in the report object with the following code (the print.range is used here to test that the workbook is loaded): import xl report = xl.Work...

94
Votes
Published 05 Aug, 2022
Python - Plotly: How to embed a fully interactive Plotly figure in Excel?

I'm trying to embed an interactive plotly (or bokeh) plot into excel. To do this I've tried the following three things: embed a Microsoft Web Browser UserForm into excel, following: How do I embed...

105
Votes
Published 05 Aug, 2022
Python - Portable Python com server using pywin32

Is it possible to run comserver without requiring elevation. For example I am able to run code from Python.TestServer (below) but it requires elevation. Python.TestServer code is at: Consuming Pytho...

24
Votes
Published 03 Aug, 2022
Python - Creating pivot table in Excel using python causes pywintypes.com_error

I adapted the following code found here to create a pivot table in my existing excel sheet: import win32com.client as win32 win32c = win32.constants import sys import itertools tablecount = itertools...

88
Votes
Published 03 Jun, 2022
Python - Write pandas dataframe to xlsm file (Excel with Macros enabled)

Writing a pandas.DataFrame into an Excel Workbook in the .xlsx format is as simple as: import pandas as pd df = pd.DataFrame({'firstColumn' : [5, 2, 0, 10, 4], 'secondColumn' : [9, 8, 21, 3, 8]}) pri...

51
Votes
Published 02 Aug, 2022
Python - Run a Python script via Excel/VBA

I've been trying to find a solution to this problem for ages. I have some python scripts that need to be updated regularly and would like to be able to use a macro to accomplish this. Right now I doub...

77
Votes
Published 31 Jul, 2022
Python - Smallest learning curve language to work with CSV files

VBA is not cutting it for me anymore. I have lots of huge Excel files to which I need to make lots of calculations and break them down into other Excel/CSV files. I need a language that I can pick up...

94
Votes
Published 31 Jul, 2022
Python - Is there a way to call a Python code in Excel-VBA?

I have an Excel file (Main.xlsm) containing macros. I have a Python file (python.py) to generate a subsidiary Excel file (sub.xlsx) which I would further call in the macros of Main.xlsm-file. This sub...

68
Votes
Published 30 Jul, 2022
Python - How to set PythonPath/ UDF_Modules?

I have been trying to build my own Excel functions using Xlwings. Using $ xlwings quickstart myproject would create a Python script in the same directory as the Excel xlsm file. I want to put t...

38
Votes
Published 06 Jun, 2022
Python - How to insert a picture into Excel at a specified cell position with python (Anaconda) use vba

I try to use this link with vba code but in Python it doesn't work. import win32com.client Excel = win32com.client.Dispatch("Excel.Application") wb = Excel.Workbooks.Open(r'C:/Users/Home/Desktop/...

58
Votes
Published 31 May, 2022
Python - Read Excel sheet table (Listobject) into python with pandas

There are multiple ways to read excel data into python. Pandas provides aslo an API for writing and reading import pandas as pd from pandas import ExcelWriter from pandas import ExcelFile df = pd.re...