Skip to content

Commit

Permalink
Merge pull request #961 from ZoomerAnalytics/xltrail-960-fix-standalo…
Browse files Browse the repository at this point in the history
…ne-build

fixed standalone build (compiler constant was in wrong place)
  • Loading branch information
fzumstein committed Oct 18, 2018
2 parents 853265a + 67dc53b commit 6d74d46
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/build_excel_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ def set_version_strings(code):
standalone_code = standalone_code.replace("Option Explicit", "")
standalone_code = standalone_code.replace("""#Const App = "Microsoft Excel" 'Adjust when using outside of Excel""", "")

# Re-add the Compiler Constant
standalone_code = ('Attribute VB_Name = "xlwings"\n' +
"""#Const App = "Microsoft Excel" 'Adjust when using outside of Excel\n""" +
'\n'.join(standalone_code.splitlines()))

for path in [standalone_mac_path, standalone_win_path]:
wb = Workbook(path)
wb.VbaProject.get_Modules()['xlwings'].set_Codes(standalone_code)
wb.Save(path)

# Save standalone as xlwings.bas to be included in python package
with open(xlwings_bas_path, 'w') as f:
f.write('Attribute VB_Name = "xlwings"\n' +
"""#Const App = "Microsoft Excel" 'Adjust when using outside of Excel\n""" +
'\n'.join(standalone_code.splitlines()))
f.write(standalone_code)

0 comments on commit 6d74d46

Please sign in to comment.