spences10 / VBA-IDE-Code-Export

Export & Import VBA code for use with Git (or any VCS)
MIT License
119 stars 34 forks source link

Tidy file structure #50

Closed spences10 closed 7 years ago

spences10 commented 7 years ago

If the majority of the code for this was in a src folder then the README would get more visibility.

@mattpalermo have you thought any more about how to build the add-in?

mattpalermo commented 7 years ago

I like this. This is how I do it on some other projects. The Base Path property can be set to "src" in the CodeExport.config.json file to achieve this.

As for the build, no I haven't. I am still experimenting with different things. For another project, my workflow is, for development, I just open the workbook and import the VBA code. Then when I want to release a new version I do two things:

  1. I have a list of tasks to do to update the workbook (I have a version number and date cell which gets changed each version). I then commit this change to the repo. I haven't automated this yet.
  2. I open the workbook again, import the VBA code, then run a macro I named PrepareForUser which automatically sets necessary worksheet and workbook protection and then prompts me to set the VBA Project password (because this can't be automated, and I will forget).

I'm not sure how much of this would be useful for this project. I thought at the moment, just opening the template and then running Import was sufficient (As described in the build instructions in the README).

What do you think?

spences10 commented 7 years ago

I tried before with a PowerShell script file so all you have to do is run one file but it was ugly and I discovered that if you didn't have the right permissions [like if you're in a corporate environment] then the script is useless so I scrapped it pretty early on.

Looking at it now it's a pretty crude script actually.

This is the thing, I want this to be as painless as possible for prospective users to install and go, there's enough fiddling around with VCS' and doing the actual coding so this shouldn't be a barrier.

mattpalermo commented 7 years ago

Yea, same, that's why I think not having to build the add-in at all is the way to go for the user. Just go to the download link, grab it and go. That's also why I'd like to implement issue #28 at some point.

Wow, I really like how simple it is to use Excel from PowerShell (I've never touched powershell before). What part couldn't be used in the corporate env?

spences10 commented 7 years ago

You need to be admin to run a PS script off of the network/local storage I think, the thing was if you copy pasta the script into PowerShell ISE you could run it, I think, can't recall exactly.

mattpalermo commented 7 years ago

Oh yes, I remember when I took that PowerShell BS to the knee once. Haha. Well you could make the same script in C# (or VB.NET). In fact, if you wanted to take it further you could mirror the functionality of the Excel Add-In in a .NET command line tool so that you could do your importing and exporting from the command line. That was my intention for effoff but maybe that should just be a part of CodeExport and have both programs in the same repo.

spences10 commented 7 years ago

Hmmm, how would effoff be installed by the user? Would it go in the project folder? Do we make an organisation for the two to go under?? I don't know mate :thinking:

mattpalermo commented 7 years ago

All good ideas. I like the installation method, since I can't figure out how to create a standalone executable.

spences10 commented 7 years ago

VBScript yo!

http://stackoverflow.com/a/31186714/1138354

So, have everything in the src folder with this buildProject.vbs file and :tada:

mattpalermo commented 7 years ago

Can you use .NET libraries from vb.script? I am wondering how we could inject the CustomUI.xml into the workbook in a vb.script environment.

spences10 commented 7 years ago

Good point, I do not know :confused:

Why isn't there one thing that does all the things, gah!!

mattpalermo commented 7 years ago

Haha, don't fret, give this a try: https://github.com/mattpalermo/effoff/releases/tag/v0.1.1

spences10 commented 7 years ago

Resolved with #58