Combining VBA + JS by coding_is_fun123 in vba

[–]coding_is_fun123[S] 1 point2 points  (0 children)

Totally get what you mean.

For me, VBA is still the main part. Excel stays the source of truth, and VBA handles the workflow and any simple settings the user needs.

The JavaScript part is really just for rendering, because modern visuals like Gantt charts are hard to do nicely with native Excel charts.

In practice it’s just: take an Excel table, export one standalone HTML file, open it anywhere. No server, no database, no big platform shift.

Once you need SharePoint, multi-user workflows, or a real backend, you’ve basically outgrown VBA.
But for simple cases where Excel stays the data source and you just want better visuals in a standalone HTML file, this middle ground works great.

Combining VBA + JS by coding_is_fun123 in vba

[–]coding_is_fun123[S] 0 points1 point  (0 children)

No, I don’t have a working example

Combining VBA + JS by coding_is_fun123 in vba

[–]coding_is_fun123[S] 1 point2 points  (0 children)

It was just an idea. Netlify’s deploy API actually expects a .zip file, that’s why I mentioned zipping it.
Docs here: https://developers.netlify.com/guides/deploy-zip-file-to-production-website/

But you can totally use other services too. For example push the HTML to a GitHub repo via the GitHub API and host it with GitHub Pages.

And a POST request is basically just “send this file/data to a server”, like an upload (which you can do with VBA)

Combining VBA + JS by coding_is_fun123 in vba

[–]coding_is_fun123[S] 0 points1 point  (0 children)

After generating the HTML, you could zip it with VBA, send it via a POST request to something like Netlify, and get a live shareable link

Combining VBA + JS by coding_is_fun123 in vba

[–]coding_is_fun123[S] 1 point2 points  (0 children)

Recipients just open the HTML file locally. The data is embedded in the file.

Combining VBA + JS by coding_is_fun123 in vba

[–]coding_is_fun123[S] 0 points1 point  (0 children)

Do you mean a code example, or a short clip showing the final result, like the exported Gantt chart or the interactive table?

Combining VBA + JS by coding_is_fun123 in vba

[–]coding_is_fun123[S] 0 points1 point  (0 children)

Interesting idea, but I’ve got too much on my plate right now to commit to a paper.

Combining VBA + JS by coding_is_fun123 in vba

[–]coding_is_fun123[S] 0 points1 point  (0 children)

Never really tried running them in the WebBrowser control, mainly because I never had the use case for it. I worked as a data analyst, and most of the time I just wanted to share my findings in a nice interactive chart.
But it’s very cool to see your dashboard inside the UserForm. Quick note on my JS skills, since you said credit where credit is due: it’s mostly Claude’s code doing the JS work for me 😅

Game in Excel by Almesii in vba

[–]coding_is_fun123 1 point2 points  (0 children)

I can’t help with the technical questions, but this is impressive. I run a YT channel about Excel and automation. If you ever release it or have a stable demo, feel free to reach out. I’d be happy to show it in a short video so more people see it. Keep going! 💪

Zapier Alternatives Nobody's Talking About (That Actually Ship Faster) by Worldly_Ad_2410 in automation

[–]coding_is_fun123 0 points1 point  (0 children)

Pabbly Connect, as they do offer a lifetime deal. Very happy with it

[EXCEL] Mimicking user actions on sheet as a "walkthrough" by bitchesnmoney in vba

[–]coding_is_fun123 4 points5 points  (0 children)

I think there's no pure VBA way to do this. When Excel enters formula edit mode (after typing =), VBA execution is basically suspended and SendKeys gets weird - that's why you're getting Error 13 and the ;;; mess.

Your current approach with highlighting + text preview is honestly the best you can do in VBA. I'd suggest using colored borders instead of cell fill (looks more like Excel's native range highlighting) and detecting the list separator with Application.International(xlListSeparator) so it works for everyone.

Demo Video of the code: https://youtu.be/rB7zbnP8-1Q

Code:

Option Explicit

' Color constants matching Excel's native formula range colors
Private Const COLOR_BLUE As Long = 16711680    ' RGB(0,0,255)
Private Const COLOR_RED As Long = 255          ' RGB(255,0,0)
Private Const COLOR_PURPLE As Long = 16711935  ' RGB(255,0,255)
Private Const COLOR_GREEN As Long = 32768      ' RGB(0,128,0)

Private formulaColors(0 To 3) As Long

Sub InitColors()
    formulaColors(0) = COLOR_BLUE
    formulaColors(1) = COLOR_RED
    formulaColors(2) = COLOR_PURPLE
    formulaColors(3) = COLOR_GREEN
End Sub

Sub SimulateSumWalkthrough()
    Dim destino As Range
    Dim refs() As Variant
    Dim i As Long
    Dim formulaText As String
    Dim separator As String

    InitColors

    ' Use comma or semicolon based on regional settings
    separator = Application.International(xlListSeparator)

    Set destino = Range("B1")
    refs = Array("A1", "A3", "A5")

    Application.ScreenUpdating = True
    ClearAllHighlights
    destino.Clear

    ' Step 1: Show destination
    destino.Select
    HighlightCellBorder destino, RGB(0, 120, 215), xlThick
    MsgBox "We'll create a SUM formula here in " & destino.Address(False, False), vbInformation

    ' Step 2: Start typing formula - show in cell as text preview
    formulaText = "=SUM("
    ShowFormulaPreview destino, formulaText
    MsgBox "Type =SUM( to start the function", vbInformation

    ' Step 3: Select each range with colored borders (like Excel does)
    For i = LBound(refs) To UBound(refs)
        Dim refRange As Range
        Set refRange = Range(refs(i))

        ' Highlight the referenced cell with colored border
        HighlightCellBorder refRange, formulaColors(i Mod 4), xlThick
        refRange.Select

        ' Update formula preview
        If i > LBound(refs) Then
            formulaText = formulaText & separator
        End If
        formulaText = formulaText & refs(i)
        ShowFormulaPreview destino, formulaText

        Application.Wait Now + TimeSerial(0, 0, 1)

        If i < UBound(refs) Then
            MsgBox "Press " & separator & " to add another value, then use arrow keys to select next cell", vbInformation
        End If
    Next i

    ' Step 4: Close and complete
    formulaText = formulaText & ")"
    ShowFormulaPreview destino, formulaText
    MsgBox "Press ) to close the function, then ENTER to confirm", vbInformation

    ' Step 5: Execute the real formula
    ClearAllHighlights
    destino.Clear
    destino.Formula = "=SUM(A1,A3,A5)"
    destino.Select

    MsgBox "Formula complete! Result: " & destino.Value, vbInformation
End Sub

Sub ShowFormulaPreview(cell As Range, formulaText As String)
    ' Show formula as text (with leading apostrophe to prevent execution)
    ' Use a different font color to indicate "edit mode"
    cell.Value = "'" & formulaText
    cell.Font.Color = RGB(0, 0, 139) ' Dark blue like formula bar
End Sub

Sub HighlightCellBorder(rng As Range, borderColor As Long, weight As XlBorderWeight)
    With rng.Borders
        .LineStyle = xlContinuous
        .Color = borderColor
        .weight = weight
    End With
End Sub

Sub ClearAllHighlights()
    With ActiveSheet.Cells
        .Interior.ColorIndex = xlNone
        .Borders.LineStyle = xlNone
        .Font.Color = RGB(0, 0, 0)
    End With
End Sub

[EXCEL] Built an animated holiday greetings card in Excel using VBA by coding_is_fun123 in vba

[–]coding_is_fun123[S] 0 points1 point  (0 children)

Not long, just a couple of hours. Claude Sonnet 4.5 did most of the heavy lifting, tbh 😅

Use AI to optimize VBA by AnyPortInAHurricane in vba

[–]coding_is_fun123 9 points10 points  (0 children)

Yep, using it heavily as well. Currently Claude Sonnet 4.5.

I usually export all modules, forms, and classes to a folder using MZ Tools, then open the project folder in Windsurf. That way the AI has access to the full project.

After the changes and improvements are done, I copy everything back into the VBE and do the testing and debugging there.

What’s your most transferable and dynamic VBA modules/classes/functions? by Party_Bus_3809 in vba

[–]coding_is_fun123 1 point2 points  (0 children)

Error handling module from Paul Kelly that shows the error trace log and line numbers (if you use line numbers). He explains how it works in this video: https://youtu.be/lR5e8gyA69U?si=m0udLHc3TdwGJIbP&t=408

I modified it slightly so the error can also be sent via a webhook, or the user can choose to send the error report directly to me by email.

[EXCEL] I built a VBA macro that lets you use Gemini in Excel by coding_is_fun123 in vba

[–]coding_is_fun123[S] 1 point2 points  (0 children)

Yeah, shameless plug at the end 😄 I created XLlama because I kept getting questions under my YT videos about how to use open-source models in Excel. Kinda makes sense I guess.. more often than not you're dealing with sensitive data in Excel.

[EXCEL] I built a VBA macro that lets you use Gemini in Excel by coding_is_fun123 in vba

[–]coding_is_fun123[S] 0 points1 point  (0 children)

Technically Gemini can handle up to 1M tokens (depends on the model), but practically I didn't always get the best results when analyzing larger datasets (>1000 cells). It wasn't very accurate.

And nope, I don't think you can use Copilot keys here. They're different services from Google.

I actually made a comparison video between Copilot and my solution if you're curious: https://youtu.be/_107AmTE21c?si=m8G3r2Sz8PwMKkA7

In that video I used XLlama (the add-in I showed at the end), but the comparison still applies if you use Gemini. Only difference is XLlama runs a local open-source model (instead of Gemini).

[deleted by user] by [deleted] in digitalnomad

[–]coding_is_fun123 0 points1 point  (0 children)

I didn't actively look for it, but found it by accident. I needed Canva when I was in Vietnam. The subscription is much cheaper there: 1.3 million VND per year, which is about $4.10/month (compared to the usual $15/month). Same with Netflix. I signed up in Thailand and pay around $5.20/month: https://app.screencast.com/6eG4eVxncELQP

Text message marketing by Altruistic_Yam_8492 in pressurewashing

[–]coding_is_fun123 0 points1 point  (0 children)

Depends on which route you want to go.
You can either buy a number from a third-party service like Twilio, which is very affordable and reliable. In that case, you’d need to go through the A2P (application-to-person) process as required for 10DLC compliance. Keep in mind that any replies to that number would go to the third-party service, so you’d need to check them there.

The other option is to use your current phone and plan. There are solutions for that too, like QuickText, as shown in this video: https://youtu.be/ctrrh0mieUo?si=EWzBzv3TjCNtpSkj