Grasshopper

algorithmic modeling for Rhino

Is it possible add and rename Excel worksheet by GH script?

Anyone know a simple trick (code/script) that is able to add and rename the worksheet in an existing Excel file? So through GH do this action? Thank you in advance!

Views: 444

Replies to This Discussion

Hi Luciano,

You may want to check out this discussion. Lots of good content there (as can be expected from Anders).
Also note that openpyxl is not fully compatible with IronPython. So I'd stick with the built-in .NET integration or the xldr module.

Best,
/SPM

Thank you Stephen, i'll give it a look!

If you don't want to rely on any external modules and instead want to write your own implementation you could look under the hood of a plug-in called Bumblebee by David Mans. 

There is also a version of that plug-in written for Dynamo that is also an Open Source project with source available here: https://github.com/ksobon/Bumblebee

A particular line of code that you would need to add new worksheets to Excel can be found in this code at line 166: https://github.com/ksobon/Bumblebee/blob/master/_nodes/Write%20Exce...

Good luck! 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service