You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows 10 Enterprise for local. Windows Server 2022 Standard for the server
3.10 Python, Microsoft 365 Apps for enterprise, 0.28.7 xlwings
I have a web interface project that is using a connection between XLwings and Dash. The Excel file is large and takes about 15 seconds to load, while the calc only takes 5 seconds. Since it is setup to run over the web, each client will have their own instance of Excel. XLwings has a way to handle this.
Currently the setup is that once the user enters their setup and clicks submit, only then does the connection start.
If this was normal python, I could just start the connection earlier. However, with Dash, the only connection between the layout, and the function definition is the Dash callback.
The goal is to load the Excel file as soon as the page is loaded, while that is happening the user would enter their parameters, the time that takes to load would be saved and the result return time would be shortened by that time.
If I setup the connection as a variable or function, it doesn't look like you can pass these through the callback in anyway.
Project requirements are that the Excel and its VBA not be converted to Python/Dash.
Possible to launch one, or a few, Excels' on launch, and have XLwings grab the PID somehow? Would another Excel extension handle this? I know we're not supposed to use 'Global' variables, but that might fit this particular need
Above the below code is the part where the layout setup is for Dash
@callback(
#many Output and Inputs. Removed most for clarity.
Output(component_id='table', component_property='data'),
Input(component_id='yearSlider', component_property='value'),
)
def finalFxn(
#many parameters. Removed most for clarity.
parameter1,
parameter2
):
with xw.App(visible=True) as app:
wb = app.books.open(r"C:\Users\mike\Downloads\modified3-31.xlsm")
#logic
# excel cells = parameters from web
#logic
# parameters to web = excel
return results, graph, etc.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Windows 10 Enterprise for local. Windows Server 2022 Standard for the server
3.10 Python, Microsoft 365 Apps for enterprise, 0.28.7 xlwings
I have a web interface project that is using a connection between XLwings and Dash. The Excel file is large and takes about 15 seconds to load, while the calc only takes 5 seconds. Since it is setup to run over the web, each client will have their own instance of Excel. XLwings has a way to handle this.
Currently the setup is that once the user enters their setup and clicks submit, only then does the connection start.
If this was normal python, I could just start the connection earlier. However, with Dash, the only connection between the layout, and the function definition is the Dash callback.
The goal is to load the Excel file as soon as the page is loaded, while that is happening the user would enter their parameters, the time that takes to load would be saved and the result return time would be shortened by that time.
If I setup the connection as a variable or function, it doesn't look like you can pass these through the callback in anyway.
Project requirements are that the Excel and its VBA not be converted to Python/Dash.
Possible to launch one, or a few, Excels' on launch, and have XLwings grab the PID somehow? Would another Excel extension handle this? I know we're not supposed to use 'Global' variables, but that might fit this particular need
Above the below code is the part where the layout setup is for Dash
Beta Was this translation helpful? Give feedback.
All reactions