Books and code

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Books and code

Post by LisaGreen »

Hello everyone,

This isn't strictly VBA but I'd like to ping/poll people about books on code.
I'm pretty sure that I've mentioned I'm writing a book.

The whole thing is totally out of my sphere of experience though, so I'm trying to get as many opinions as possible from people who read/look at his stuff. You!
At the moment my thinking is to present the book as a word document to be downloaded from a site with a donate button.
Aaaaand... That's the first Q!! Should it be PDF? Should I approach a publisher to hard copy it? SHould I leave it as a word document? Should I build a web site and put everything on the net?
The book is called VBA for the VBE and there's a LOT of code there.
Should I separate the code from the document/book and use links / references to files/ some other method?
I'm concerned because there are about 6k lines of code so far and it's 400+ word doc pages and it's only about 1/2 done.

What would everyone prefer?
What was the best coding book you read formatted like?
Have you got any niggles about any coding books you've read?
What really gets you dander up about such books?
What would you LIKE to see?
Etcetera,...etcetera,... etcetera.

Give me your grumbles
Give me your praise
Help me to see how
My text I can raise
If you tell me your words
If you say how you feel
You will very much help me
To approach this with zeal!

TIA and waiting tentatively...
Lisa

User avatar
HansV
Administrator
Posts: 78700
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Books and code

Post by HansV »

I wouldn't publish it on paper - most programmers prefer digital content nowadays.

Do you want to make money from the book? If so (and even if not), you might consider publishing it as an e-book (Amazon Kindle, Rakuten Kobo, …)

Otherwise, a website would be nice. You could use a blog platform such as WordPress or Blogger; you can include links, pictures, create an index, ...
Best wishes,
Hans

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Books and code

Post by LisaGreen »

Oh thank you so much Hans!!!!

I've been worried that noone would reply at all!!!

Lisa

User avatar
AlanMiller
BronzeLounger
Posts: 1545
Joined: 26 Jan 2010, 11:36
Location: Melbourne, Australia

Re: Books and code

Post by AlanMiller »

Just a couple of thoughts ...

Do you intend that the code can be copy/pasted into the VBE to "have a play" with? If so, ensure that this is a "clean" operation, without the need to adjust carriage returns, tabs etc. Work out an appropriate Style for code blocks and use that consistently in the Word doc.

I tend to publish PDF from the master Word doc. It's possible to use various levels of protection (copy, print etc.) in the PDF, but these are circumventable if you're determined enough. I use a commercial product to produce a PDF with an expandable TOC which displays in a side-panel in Adobe Reader etc. But I think there are freebie alternatives. But using Word Heading Style hierarchies is what makes this possible. So use Styles to ensure such a structure (Heading 1,2,3 ...) is present in the Word doc.

I look forward to seeing the finished masterpiece!

Alan

EDIT: And no offence, but I'd forego the idea of presenting the material in rhyming stanzas like the bottom of your post. :grin:

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: Books and code

Post by Doc.AElstein »

I have been posting less in forums and more at Blog sites and a major annoyance is problems with format changing in code copying and pasting. Alan Miller was talking about this, I think.
Another problems is with different quotes, “ , for example, as there seem to be different ones, and often when you copy from a Blog site to the code window, the quotes all turn red. That’s no problem for an experienced person to deal with, but it can really confuse and put off someone with little experience.

Whichever media you choose to use, I personally would like code to be in a code window that looks similar to the VB Editor as you see on your computer. In particular, I would very much like to see the Code window with scroll bars.
The horizontal scroll bar I particularly love. You have loads of space to the right where you can include explanatory notes, hyperlinks etc, and other vulgarities of your choice in the ‘Comments. Some people prefer not to see those, but as these are “hidden” to the right , you can choose if and when you want to scroll to the right to see the extra info. As you do not see it unless you scroll to the right, it does not clutter your view when viewing normally

Another Possibility is to share the codes via something like “Paste bin”. ( https://pastebin.com/" onclick="window.open(this.href);return false; ) That is free. I have the subscribed version which was just a few Euros, for a lifetime subscription, ( they put on such an “offer” from time to time ). You can then have folders, edit and do a few other things that I haven’t worked out yet. ( Unfortunately there isn’t a horizontal scroll bar, but I spoke to them about it, and they thought it was a good idea and said they may do it ). It does support the color coding syntax.
Another thing I use is the Sub Forum of an Excel Forum, as the owner gave me permission to dump my codes there. The code window there looks very similar to the VB Editor, with scroll bar, and it supports the colours , so the codes look more or less identical there as to how they look in the VB Editor code window.
Some Excel Forums have a Tips and Tutorials Sub Forum. Often they have rules that say you must have been a member a while and have contributed to answering questions before you post a lot of your own “Blog” type material. But you might be able to contact the owner or administrator to ask permission to post a one off “Blog/Book” thing.

I sometimes use Word docos to share “Blog” type material. Unfortunately there is no built in Code window in word.
Or maybe there is and I don’t know about it.
Or maybe it can be done and I don’t have a clue how to do it.
Depending how and from where you paste into Word, you can get a full formatted and colourered code into word. It would be nice if you could have a code window with scroll bars to put it in.

Another thing for if you use a media like word or a forum or blog site: Consider using “deep links” . That is to say, make your section headings the hyperlink things that you can click on. Those links should take you to the particular section. That is very useful , I find, in the case of a blog site, to get the URL link which you can use to get straight to a particular section for future reference of some particular section.

Alan

Edit P.S: I would vote for the rhyming stanzas and any other Human trivialities or Human comical stupidities or amusing vulgarities you care to add :-) , but probably be better to keep them out for the wider acceptance .. unfortunately :(
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Books and code

Post by LisaGreen »

OMG!!!

The answers so far are sooooo good!! Thank you everyone!!

.... And I've been looking at online examples.

Do you like the code table doodads shown on this page?
https://sweetcode.io/scrollable-selectable-html-table/

Loads and loads of TIAs!!!!
Lisa

User avatar
HansV
Administrator
Posts: 78700
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Books and code

Post by HansV »

That looks really good!
Best wishes,
Hans

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Books and code

Post by LisaGreen »

I thought so too Hans!!

I love the choice icons in the header row... line numbers/copy and so on!

And all of the code is there too!!

I think I'm going to get in touch and ask them if it's ok to use. I'd change it a little though to make it look prettier for me. Because it's where it is and the subject I think it is useable, but it doesn't ever hurt to ask I think. I think a download utton would be nice as well maybe.

Regarding colouring and so on, I've started saving the snippets with a vb extension. Notepad++ will then open it as a vb file with the right syntax colours.

It mentions crayons a lot and I have no idea what those are though.

Lisa

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: Books and code

Post by Doc.AElstein »

I guess all that scrolling is vertical? Apparently horizontal scrolling is difficult to do… http://www.eileenslounge.com/viewtopic. ... 74#p243274" onclick="window.open(this.href);return false;
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Books and code

Post by LisaGreen »

Hi,

So! A web solution it is!
And I have a web site and have been playing with it.

If anyone is interested you are welcome to look at it.

At the moment I'm converting the docm file to a pdf and putting it on the site but the docm file is there to download as well.

I've charged my brother Mike with writing the book. I have a sort of aversion to public thingies.
Please be aware though that it's not finished yet!! We estimate it should be dusted by end of July 2019, so if you look at it you're looking at an unfinished product.

Comments are of course, always welcome and I'll pass them along to Mike... hehehe.

The web site is thinkz1.com

Regards
Lisa

User avatar
HansV
Administrator
Posts: 78700
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Books and code

Post by HansV »

You may want to mention in the introduction that for any of the code to run, users must tick the check box 'Trust access to the VBA project object model' in the parent application, in File > Options > Trust Center > Trust Center Settings > Macro Settings.
Best wishes,
Hans

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Books and code

Post by LisaGreen »

Thank you Hans!!! Done!... Mike had a mumble grumble because he thought it was obvious.

In my opinion though, leave as little to doubt as possible!

Lisa

User avatar
AlanMiller
BronzeLounger
Posts: 1545
Joined: 26 Jan 2010, 11:36
Location: Melbourne, Australia

Re: Books and code

Post by AlanMiller »

I had just a cursory look at your site Lisa. It will be interesting to comb through - lots there!

I did have a thought on a topic that comes up here now and again - Excel 4 macros. It may not be of relevance, but reference is made to it here:

Excel 4 Macro Help in .CHM Format
File and quoted description below supplied by our very own AlanMiller
There is occasionally a reference made to Excel 4 macros. The old help file for these is in the Windows .HLP format, which requires a special viewer on modern Windows versions. The link below contains my own attempt at converting this to a .CHM file. While I think all the contents translated across, some organization features are lost. If there is a demand, I can redo it more thoroughly.

You are welcome to include it of course if it's of relevance. If so, I could have a go at doing a more thorough job on the file conversion mentioned.

Alan

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Books and code

Post by LisaGreen »

Hello Alan!

This is so interesting!

There's a lot at the link you posted so I'm going to take a bit of time to look at that.

Thank you!

Edit: Mike thinks it's a great idea to include a link to that thread. Probably in the appendices.
Would you suggest another place?

01:38 here... My bro is still up but I need my bed right now!

Please keep any comments coming!

Regards
Lisa

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: Books and code

Post by Doc.AElstein »

Hi Lisa,

As I mentioned to you, I could not get as far as I was intending with your book.
The book seems to be done in a sort of “chain way” and one section feeds on from the other.
So if you get stuck anywhere, as I did, then that’s the end of it. I personally don’t mind that sort of a long chain style. But I am a bit untypical in that respect. I think that sort of way of doing things could be a bad move for the wider audience.
Please don’t misunderstand any comments from me that might sound very critical. I am personally always in Awe and have great respect for, and have been extremely grateful for , all the efforts people make supplying free help and info at blogs, forums, books available on the internet etc…etc… . But I have noticed the internet getting flooded and in the past years, many people have abandoned and given up trying to maintain their “blog work”. Sometimes they can’t keep up with follow up questions and comments. I think to make any head way or get anyone to read anything you offer is getting very difficult. People are getting “spoilt” for choice, and if they don’t get quickly and easily at the information they want then they just click elsewhere. I am not sure if many people would have the patients to go through your book as it is currently organised.
Having said all that, I think there is the potential for a good blog site or similar to get a lot of interest over the next few years. I think we may see the painful death of some long established (Excel) Forums that have some weirdoes in them trying to maintain some sort of order / rulings that just don’t fit with the fact that so much “free” info is available at ones finger( or thumb ) tips these days. ( Of course it is mostly/ usually not “free” – Eileen’s Lounge is one of a minority of help giving places that does not have adverts or some “ hidden “ way of generating money from people viewing. ( I am not making any judgement at all on having advertisements or whatever means some place have to generate money from viewings of their stuff, – just pointing it out, that’s all ) )
I’m rambling a bit, as I do. That’s OK , you shouldn’t necessarily take too much notice of the comments I made, I don’t always…

“VBA for the VBE” is a long “blog”, I suppose that is why you call it a “book”. :-) But I think it is worth a read, I learnt from it already a bit and as a result made a few small changes to some of my “blog stuff”. I’ll probably steal some of the codes if I do manage to get further into it later.

So…
I have about 9 sides of comments so far in a word doco “LisaBookFeedback.docx“. This corresponds to about the first 64 pages of your book.
I also have a copy of your book, “VBA For The VBE Read by Alan.docm” where up to about page 64 I have noted some very minor typos in purple ( only about 9 I think )
I also have started an Excel file, “LisaBook.xls“ , where I have your routines that I have looked at so far, along with some minor modification I had to make to get them to work.

I can’t get any further with it, as it is , because of the problems I had. It might also be that I made some stupid mistake. But it is a good test of a book if I can get through it – then anyone can … it is not such a good test of a book if someone who already knows it all checks it as they can’t pick out missing bits or errors as they don’t need to concentrate so much. Some of the best teachers are often the biggest idiots.. I have often been complimented about being a good teacher :sad:

See you and everyone in the New Year..
Have a good :fanfare: :fanfare: :cheers: :cheers: Rutsch everyone :-)

Alan
_._________________________
I will try to upload as much as I can, ( I expect your book will be too big ) , otherwise I have it in cloud at these links :

VBA For The VBE Read by Alan.docm” : https://app.box.com/s/vfjtsrtailnw2wbrri38srtm4x711l6n" onclick="window.open(this.href);return false;
LisaBook.xls” : https://app.box.com/s/5iphi8dr29g1bc0fu7pzx7tu2xrv9t4y" onclick="window.open(this.href);return false;
LisaBookFeedback.docx : https://app.box.com/s/jro636fnfastnbggb62ue5dk5nxra23b" onclick="window.open(this.href);return false;
You do not have the required permissions to view the files attached to this post.
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Books and code

Post by LisaGreen »

@Hans
HansV wrote:I wouldn't publish it on paper - most programmers prefer digital content nowadays.

Do you want to make money from the book? If so (and even if not), you might consider publishing it as an e-book (Amazon Kindle, Rakuten Kobo, …)

Otherwise, a website would be nice. You could use a blog platform such as WordPress or Blogger; you can include links, pictures, create an index, ...
I'm going over my last two Qs to the forum.

I'm not going to charge except for a donate button.
The code isn't by any means pristine and I would feel very guilty. But I just hope that some of the code will be useful to someone.

Lisa

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Books and code

Post by LisaGreen »

AlanMiller wrote:Just a couple of thoughts ...

Do you intend that the code can be copy/pasted into the VBE to "have a play" with? If so, ensure that this is a "clean" operation, without the need to adjust carriage returns, tabs etc. Work out an appropriate Style for code blocks and use that consistently in the Word doc.

I tend to publish PDF from the master Word doc. It's possible to use various levels of protection (copy, print etc.) in the PDF, but these are circumventable if you're determined enough. I use a commercial product to produce a PDF with an expandable TOC which displays in a side-panel in Adobe Reader etc. But I think there are freebie alternatives. But using Word Heading Style hierarchies is what makes this possible. So use Styles to ensure such a structure (Heading 1,2,3 ...) is present in the Word doc.

I look forward to seeing the finished masterpiece!

Alan

EDIT: And no offence, but I'd forego the idea of presenting the material in rhyming stanzas like the bottom of your post. :grin:
@Alan... and many apologies this may seem late.... I'm going back through all the posts for the last two Qs I've posted.
Your PDF point was to the er... point. Along with Hans' about electronic material. Soooo... on thinkz1.com you should find a PDF, and a DOCM. But! I suspect you already know that!!!

Our estimate for "the end" or as Mike says... top of the curve... is still End of July.

And thank you!
Lisa

LisaGreen
5StarLounger
Posts: 964
Joined: 08 Nov 2012, 17:54

Re: Books and code

Post by LisaGreen »

AlanMiller wrote:Just a couple of thoughts ...

Do you intend that the code can be copy/pasted into the VBE to "have a play" with? If so, ensure that this is a "clean" operation, without the need to adjust carriage returns, tabs etc. Work out an appropriate Style for code blocks and use that consistently in the Word doc.

I tend to publish PDF from the master Word doc. It's possible to use various levels of protection (copy, print etc.) in the PDF, but these are circumventable if you're determined enough. I use a commercial product to produce a PDF with an expandable TOC which displays in a side-panel in Adobe Reader etc. But I think there are freebie alternatives. But using Word Heading Style hierarchies is what makes this possible. So use Styles to ensure such a structure (Heading 1,2,3 ...) is present in the Word doc.

I look forward to seeing the finished masterpiece!

Alan

EDIT: And no offence, but I'd forego the idea of presenting the material in rhyming stanzas like the bottom of your post. :grin:
@Alan,

I never said before, and by now you know I'm going *backwards* through the posts... silly woman!! But this is great information! Do you ever have any trouble with word "master documents". I've read a *lot* about them not being very stable. What commercial product do you use? We are using the standard hearders in msword to create a TOC and Table of figures for a table of tables, with "code" set as the category, and a table of figures, And I want to include another couple of tables as well.

I was thinking of including a non VBVA/VBE chapter on "Word stuff" in terms of how the document was created and so on. What do you think?

Lisa