Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    VBA code to HTML

    Does anyone have any experience with or comments about Converting VBA code into HTML - COM add-in (164kb) - by bykin, 08.Jun.2003 as found here?

    T.I.A.
    Regards
    Don

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: VBA code to HTML

    The README file has this further explanation:
    <hr>This is a COM Add-in that converts VBA code into HTML, it works with Microsoft Office Applications(Access, Excel, FrontPage, Outlook, PowerPoint, Publisher, Visio, Word) that incorporate VBA via the VBE(Visual Basic Editor).

    With this utility, you can conveniently print out the code with color that can not be done via the VBE alone. The generated code is in an HTML format, you can use then code for presentations, e.g.,upload the code to a website.<hr>
    Haven't tried it myself.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA code to HTML

    I don't know what you want to use it for - it's fine if you want to publish VBA code on your website, but you can't use it here in Woody's Lounge since we don't allow Loungers to use HTML code directly (it's too dangerous).

  4. #4
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VBA code to HTML

    Thank you for the insight Hans. I now have no need nor intent to use it.
    Regards
    Don

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA code to HTML

    Don

    Have a look at the thread Print code of only 1 module (Excel 2003 SP1). Jan Karel pieterse and I modified/ hacked the code to make it run on Woody's Lounge. I've reattached here.

    To use it, you
    Load it as an Excel add-in.
    Select your code in the editor
    Select Tools, convert selected code as BBcode (or one of the other options). This copies it to the clipboard, ready for pasting direct into your Lounge post.

    Should work OK on non-Excel VBA, pasted into the VBE open in Excel.

    Here's a sample:

    <div style="width: 100%; background-color: #FFFFFF;"><code><font color=black><font color=blue>Option</font color=blue> <font color=blue>Explicit</font color=blue>

    <font color=blue>Private</font color=blue> <font color=blue>Declare</font color=blue> <font color=blue>Function</font color=blue> LockWindowUpdate <font color=blue>Lib</font color=blue> "user32" (<font color=blue>ByVal</font color=blue> hwndLock <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue>) <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue>

    <font color=448800>'Application constant names</font color=448800>
    <font color=blue>Public</font color=blue> <font color=blue>Const</font color=blue> AppCode = "VBHTML"
    <font color=blue>Public</font color=blue> <font color=blue>Const</font color=blue> AppName = "VB HTML Maker"

    <font color=448800>'Constants to identify the colors in _
    the BBColor and HTMLColor functions</font color=448800>
    <font color=blue>Private</font color=blue> <font color=blue>Const</font color=blue> BLACK <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue> = 1
    <font color=blue>Private</font color=blue> <font color=blue>Const</font color=blue> BLUE <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue> = 2
    <font color=blue>Private</font color=blue> <font color=blue>Const</font color=blue> GREEN <font color=blue>As</font color=blue> Long = 3

    <font color=blue>Dim</font color=blue> cBtn As clsBtn

    <font color=448800>'Converts the specified text with the VBE Color (Black, Blue or Green) using BB code</font color=448800>
    <font color=blue>Private</font color=blue> <font color=blue>Function</font color=blue> BBColor(<font color=blue>ByVal</font color=blue> Color <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue>, ByVal Text <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>) <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>
    <font color=blue>Dim</font color=blue> Msg <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>
    <font color=blue>Dim</font color=blue> sColor <font color=blue>As</font color=blue> String
    sColor = Choose(Color, "black", "blue", "green")
    Msg = "[" & sColor & "]" & Text & "[/" & sColor & "]"
    BBColor = Msg
    <font color=blue>End</font color=blue> <font color=blue>Function</font color=blue></font color=black></code>
    </div hiblock>

    Alan
    Attached Files Attached Files

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA code to HTML

    As you see, editing the post can break some of the tags! <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

    Here's how it was before the edit of the post above:

    <div style="width: 100%; background-color: #FFFFFF;"><code><font color=black><font color=blue>Option</font color=blue> <font color=blue>Explicit</font color=blue>

    <font color=blue>Private</font color=blue> <font color=blue>Declare</font color=blue> <font color=blue>Function</font color=blue> LockWindowUpdate <font color=blue>Lib</font color=blue> "user32" (<font color=blue>ByVal</font color=blue> hwndLock <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue>) <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue>

    <font color=448800>'Application constant names</font color=448800>
    <font color=blue>Public</font color=blue> <font color=blue>Const</font color=blue> AppCode = "VBHTML"
    <font color=blue>Public</font color=blue> <font color=blue>Const</font color=blue> AppName = "VB HTML Maker"

    <font color=448800>'Constants to identify the colors in _
    the BBColor and HTMLColor functions</font color=448800>
    <font color=blue>Private</font color=blue> <font color=blue>Const</font color=blue> BLACK <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue> = 1
    <font color=blue>Private</font color=blue> <font color=blue>Const</font color=blue> BLUE <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue> = 2
    <font color=blue>Private</font color=blue> <font color=blue>Const</font color=blue> GREEN <font color=blue>As</font color=blue> Long = 3

    <font color=blue>Dim</font color=blue> cBtn As clsBtn

    <font color=448800>'Converts the specified text with the VBE Color (Black, Blue or Green) using BB code</font color=448800>
    <font color=blue>Private</font color=blue> <font color=blue>Function</font color=blue> BBColor(<font color=blue>ByVal</font color=blue> Color <font color=blue>As</font color=blue> <font color=blue>Long</font color=blue>, ByVal Text <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>) <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>
    <font color=blue>Dim</font color=blue> Msg <font color=blue>As</font color=blue> <font color=blue>String</font color=blue>
    <font color=blue>Dim</font color=blue> sColor <font color=blue>As</font color=blue> String
    sColor = Choose(Color, "black", "blue", "green")
    Msg = "[" & sColor & "]" & Text & "[/" & sColor & "]"
    BBColor = Msg
    <font color=blue>End</font color=blue> <font color=blue>Function</font color=blue></font color=black></code></div hiblock>

    Also, a right-click on the VBE code or selection should bring up the menu options.

    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •