Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Handling is lacking for some routines and functions #31

Closed
RaymondWise opened this issue Aug 7, 2015 · 2 comments
Closed

Error Handling is lacking for some routines and functions #31

RaymondWise opened this issue Aug 7, 2015 · 2 comments
Assignees
Milestone

Comments

@RaymondWise
Copy link
Contributor

Module Action
Chart_Format.VBA sub Chart_CreateDataLabels()
Chart_Format.VBA sub ChartCreateXYGrid()
Chart_Processing.VBA sub CreateMultipleTimeSeries()
Chart_Series.VBA sub ChartMergeSeries()
Usability.VBA function GetRow()
Usability.VBA sub ExportFilesFromFolder()
Usability.VBA sub FillValueDown()
Usability.VBA sub SeriesSplit()
@byronwall
Copy link
Owner

I will add error handling to these. It is definitely needed. I have been using that SeriesSplit lately and have been getting annoyed when I hit cancel and get a runtime error.

The GetRow function probably needs to be integrated into the place where it is used. I think it is just used for the Copy as CSV feature. I was being lazy when I did that one and just needed a quick solution. That is a decent feature to have but it needs some improvement. I'll take a look at it and create a new issue.

I will add error handlers to the other ones. Most of them are using InputBoxes which are very likely to have an error at some point.

@byronwall byronwall self-assigned this Aug 10, 2015
@byronwall byronwall modified the milestone: v0.1.0-beta Aug 10, 2015
byronwall added a commit that referenced this issue Aug 11, 2015
Commit involves a number of changes:
- Adds error handlers or changes code to not need them, see #31
- Adds a Sub to DeleteAllCharts and replaces previous usages of this,
see #36
- Adds a Function to GetInputOrSelection which prompts for a Range with
Selection as default, see #14
- Removes the GetRow function for the CSV Sub and instead uses a double
Transpose, related to #31
- Adds a couple of comments throughout for TODO items
- A couple of items have their case changed rows->Rows.  The VBE is
doing this automatically.
@byronwall
Copy link
Owner

All of the Subs mentioned above have error handlers added or the code changed to not throw errors. For the Chart related ones, I replaced the Selection with the Function Chart_GetObjectsFromObject. This is a poorly named function that goes through whatever object (usually Selection) and returns a Collection of ChartObjects if there are any contained in the Selection. This makes error handling easy since the collection will be empty if nothing was there and the For Each will simply skip over the empty Collection.

For GetRows, I just deleted it and replaced the one usage with a double Tranpsose. It works just as well.

For 2 of the Usability ones, I replaced Selection with a Function GetInputOrSelection which is the new bit covered by #14 . Error handling can be done inside that Function with a new check that the return of the Function Is Nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants