PDA

View Full Version : BB codes with Excel 365



Voigon
09-24-2019, 08:46 PM
Hello guys :)
This is my first time at this forum. I came here looking for a way to convert excel tables to BB code with colors.
It is also worth saying that I have no experience what so ever with macros / vb / vba, just a very basic knowledge of Excel. With that said I am well versed in Java development.
I came upon this thread: http://www.excelfox.com/forum/showthread.php/2077-BBCode-Table

I have tried to use it with Excel 365 (latest version of it), I have enabled the Developer tab and added the keyword "PtrSafe" the the declarations of system functions, as per the instructions of the macro console (my system is 64 bit).
I have created and saved a macro enabled excel table and put content in it, but I am getting two errors one after the other (get one, click OK, then get the other):
Error 1: Could not unlock memory location. Copy aborted.
Error 2: Could not close clipboard.

Generally speaking my goal is easy creation of tables with colors for VBulletin 4.
Can anyone help me with it? Do I need to run this on a 32 bit system?
Any help will be appreciated :)

DocAElstein
09-24-2019, 09:17 PM
Hello Voigon
Welcome to EXCELFOX
I only have up to Office 2010, but I do know that there are a lot of quirky bugs and problems with anything to do with the clipboard above Office 2010.

A better starting point for you might be to try out the BB Code generator in the add-in that you can get from Rory Archibold
It is at a link given towards the bottom of this page at his Blog site: http://excelmatters.com/excel-forums/
This is the link I think:
https://www.dropbox.com/s/umis204g6eacu7m/Forum%20Tools.xlam?dl=0

If you then still experience problems, then Rory would probably be the best person to try to get in touch with. (He does not post here, but you can find him most everywhere else, for example at MrExcel.com( https://www.mrexcel.com/forum/index.php ) or ExcelForum.com )

Alan

( P.s. This file of mine here:
https://www.excelforum.com/tips-and-tutorials/1089404-posting-an-html-table-in-a-forum-thread.html#post4642554
https://app.box.com/file/33117103789
https://app.box.com/s/zhz7awdag4nl1zs6564s9zzcwp50e4w9
has a lot of BB code generating macros, including earlier versions of Rory's. (I have them as simple stand alone runable macros, rather than add-ins. To run them you just highlight the range you want , then run the main code. Your table, in BB Code form should then be in the clipboard)
But I have no experience using any of those macros in anything above Excel 2010)

Voigon
10-03-2019, 01:53 PM
Hello Voigon
Welcome to EXCELFOX
I only have up to Office 2010, but I do know that there are a lot of quirky bugs and problems with anything to do with the clipboard above Office 2010.

A better starting point for you might be to try out the BB Code generator in the add-in that you can get from Rory Archibold
It is at a link given towards the bottom of this page at his Blog site: http://excelmatters.com/excel-forums/
This is the link I think:
https://www.dropbox.com/s/umis204g6eacu7m/Forum%20Tools.xlam?dl=0

If you then still experience problems, then Rory would probably be the best person to try to get in touch with. (He does not post here, but you can find him most everywhere else, for example at MrExcel.com( https://www.mrexcel.com/forum/index.php ) or ExcelForum.com )

Alan

( P.s. This file of mine here:
https://www.excelforum.com/tips-and-tutorials/1089404-posting-an-html-table-in-a-forum-thread.html#post4642554
https://app.box.com/file/33117103789
https://app.box.com/s/zhz7awdag4nl1zs6564s9zzcwp50e4w9
has a lot of BB code generating macros, including earlier versions of Rory's. (I have them as simple stand alone runable macros, rather than add-ins. To run them you just highlight the range you want , then run the main code. Your table, in BB Code form should then be in the clipboard)
But I have no experience using any of those macros in anything above Excel 2010)


Hello,
First of all thank for for the response! It is very appreciated.
I am now running Office 2010, and indeed the clipboard seems to work. However, I ran into a problem: Using Hebrew characters would output `?` in the BB Code, Do you have any lead for me as to how to solve this issue?

DocAElstein
10-03-2019, 04:07 PM
....., I ran into a problem: Using Hebrew characters would output `?` in the BB Code, Do you have any lead for me as to how to solve this issue?
Hello Voigon,

An interesting question , but I doubt that I can give much more than some general comments on this one… not yet anyway..

I am not fully familiar with the various BB-Code-generating coding which I referred to, as I have only made minor modifications to them. I was not involved in any of the original writings of the coding.
But it does not surprise me that you hit the "???" output type problem.

My guess is that VBA only supports English stuff mostly, for example, such that text strings held are somehow held in terms of strings of English characters. I am not sure of the exact process. But I have often seen , that characters which are not English, are usually held and shown in VBA held strings as ?s

However, I am glad you brought this up, as I do intend finally getting around late this year to writing my own BB Code generating macro, possibly as an Add-In , if I can figure out how to do that. I will certainly consider this aspect. I will make a note to post a follow up here..

As far as I know, there are no coding available that will allow you to get a BB Code which has other language text preserved. I am not even sure yet if it is at all possible.


I have not really thought too much yet about how I would tackle this problem yet.
But I guess my start point will be to remind myself of some of the work I did for this Thread:
http://www.excelfox.com/forum/showthread.php/2302-quot-What%E2%80%99s-in-a-String-quot-VBA-break-down-Loop-through-character-contents-of-a-string
Then I will google a bit , and read things like this,
https://answers.microsoft.com/en-us/msoffice/forum/all/use-hebrew-characters-in-vbe/00f37b72-8a6d-4b9b-a576-95af5f29e324 ,


My initial approach will probably be then to see if I can record what is in a cell in terms of a breakdown of its characters , ( rather than the simple cell.Value type approach , which takes a complete string into VBA , and most likely results in the "???" held for non English characters. )
I don't know at this stage if this approach will be successful.


So, I am afraid I can not be too much help just now on this one.
I will post again if I get anywhere later on this when writing my own BB Code generator later this year.
Please let us know if you make further progress
Good luck

Alan