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

Fix linefeed character #2

Open
Greedquest opened this issue Jan 13, 2023 · 6 comments
Open

Fix linefeed character #2

Greedquest opened this issue Jan 13, 2023 · 6 comments

Comments

@Greedquest
Copy link
Owner

Greedquest commented Jan 13, 2023

Repo uses LF not CRLF meaning .bas .cls files cannot be imported by VBE or RD. Need to use .gitattributes file to fix treatment.

Workaround execute the following two in powershell in the src directory of this repo to fix the newlines:

function Normalise{
param($file)
((Get-Content $file) -join "`r`n")  | Set-Content $file
}

And in the src directory

Get-ChildItem -File | ForEach-Object {Normalise $_.fullname}
@sergeos
Copy link

sergeos commented Jan 21, 2023

Ok.
For the first in the example we need to replace Set MyTable to Set fooTableEvents
For second, if we are delete some rows, and after adding value under rows we catch an error in DefaultCategoiser:
изображение

@Greedquest
Copy link
Owner Author

Greedquest commented Jan 21, 2023

@sergeos

For the first in the example we need to replace Set MyTable to Set fooTableEvents

I'm guessing you are referring to the README quickstart example. Thanks for the heads up - fixed in e97f37b

For second, if we are delete some rows, and after adding value under rows we catch an error in DefaultCategoiser

Yes I need to work on that, as the comment in the code suggests, the situation where multiple rows are added at once is not handled yet, same with multiple columns and multiple column names being changed. If you add one row at a time it should work. But that is on the TODO list. I just need to decide if, when several rows are added, I want to raise multiple "RowAppended" events or a single "RowsAppended" event. Not sure?

Thanks for testing my library!

@sergeos
Copy link

sergeos commented Jan 22, 2023

I just need to decide if, when several rows are added, I want to raise multiple "RowAppended" events or a single "Row_s_Appended" event. Not sure?

I think enough a simple event when added a row, no matter one or more.

Further, if we delete all rows through the context menu, and then the next time a value is added, the row_appended/row_inserted event does not fired. I think this is because ListObject.DataBoundRange is Nothing when has none of values in it.

Further, if we resize the border of the listobject (I think you know such a small triangle at the bottom right of the ListObject) , we also do not receive any event. Now, I am also currently using subclassing over shapes, maybe it will be helpful also in your project? See it here https://gist.github.com/sancarn/246c0bbe2c8ec35cb492865a9843e3c6
Maybe ListObject have same behavior as the Shape?

Thank you for sharing your fine project.

@Greedquest
Copy link
Owner Author

Greedquest commented Jan 22, 2023

Further, if we resize the border of the listobject (I think you know such a small triangle at the bottom right of the ListObject) , we also do not receive any event. Now, I am also currently using subclassing over shapes, maybe it will be helpful also in your project? See it here gist.github.com/sancarn/246c0bbe2c8ec35cb492865a9843e3c6
Maybe ListObject have same behavior as the Shape?

@sergeos Resize, Move, and maybe OnSort/Filter are all on my todo list (Resize and Move I know can be done as I've drafted them previously).

Thanks for the link although that uses quite a different technique for shapes to tables they're not really comparable.

if we delete all rows through the context menu

Can you clarify I'm not sure what you mean. I was not aware you could remove every single row of a table leaving only the headers? If a single row is left this code should handle that edge case.

PS Can I check with you I have a new release https://github.com/Greedquest/ListObject-WithEvents/releases/tag/v0.1.0-alpha which includes a demo workbook can you recreate the issue in that? On the sheet called "ScratchSheet". I just put a table with randomly generated data for testing

@sergeos
Copy link

sergeos commented Jan 22, 2023

Now was error occurs
изображение

@Greedquest
Copy link
Owner Author

Apologies I never got back to you. For that you need to add a reference to Rubberduck in Tools/References. Do you use that?
www.github.com/rubberduck-vba/Rubberduck

If not then you can delete any of the code in modules that doesn't compile, they are just the testing modules and I should probably exclude them

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