ArnoldSouza / SapRefresh

A python script to refresh SAP Analysis for Office Excel Workbooks
MIT License
21 stars 7 forks source link

Doccument/Examples for usage #4

Open prabhuSub opened 2 years ago

prabhuSub commented 2 years ago

Hi Developers, Appreciate you guys developing this library. I wanted to raise this issue as a method to connect to ask for some sample/examples of usage. or some documentation on usage.

Thank you.

BenBenWoodward commented 2 years ago

Hello, have you been able to implement the scripts into your own needs?

prabhuSub commented 2 years ago

Hello, have you been able to implement the scripts to your own needs?

Nope. I couldn't as this seems less comprehendible with no documentation for reference to implement based on our need. I have been waiting for one. @BenBenWoodward - any clue from your end?

BenBenWoodward commented 2 years ago

I was not able to use the script, I could not work out where to start with it.

I have been able to get SAP to refresh via VBA though by telling the Analysis for Office add-in to launch before I open my workbook. This was by the time Python opens my workbook the VSTO add-in has also load and my macros can run.

Below is the script I use.

import os import win32com.client from win32com.client import Dispatch

Launches SAP Office for Analysis

os.system('"C:\Program Files\SAP BusinessObjects\Office AddIn\BiOfficeLauncher.exe"')

Launch Excel and Open Wrkbook

xl=win32com.client.Dispatch("Excel.Application")
wb=xl.Workbooks.Open("C:\...\...\...\File_Name.xlsm")

Make Excel Visible

xl.Visible = True xl.DisplayAlerts = False

Run Macro

xl.Application.Run("File_Name.xlsm!ModuleName.MacroName")

Save, CLose and Quit.

wb.Save() wb.Close() xl.Quit()

Cleanup the com reference.

del xl

sergiodearagon commented 2 years ago

How do add attributes to the load of the xlsm

wanx4910 commented 1 year ago

Ditto, has anyone figure out how to use this library? The dev didn't release any documentation.