AI generated Macro Code??

Hey everyone,

I am not a macro coder at all.

I saw some examples of AI generated Python code that people have been posting YouTube videos about. They are very worried that the AI has the ability to generate code based on simple text input explaining what they want to code to do.

So, I was curious if it could write a CorelDraw X4 macro

Here's the prompt I used

Write a coreldraw x4 macro that will alternate between uppercase and lowercase of the selected text

Here's the code that it created based on that prompt

Sub AlternatingCase
  Dim objText As TextRange
  Set objText = ActiveSelection.TextRange
  Dim i As Long
  For i = 1 To objText.Length
    If objText.Chars(i).Case = cdrCaseLower Then
      objText.Chars(i).Case = cdrCaseUpper
      objText.Chars(i).Case = cdrCaseLower
    End If
End Sub
I was curious to hear from the master coders here what you think of this AI generated code?
  • I'm not a master coder, so I can't tell you what they would think of that. But I am interested in trying it out too. Can't seem to find a place to do so. Searching for it, all I seem to come across are articles/videos that talk about this, but also don't link to somewhere it can be tested. Where did you go to enter that code request?

  • Jason, 

    Did you try the code? Let me spoil it for you, it doesn't work. :-)  And not for one reason but several. :-) 

    I am not worried about AI taking my job. That said, I am all for using AI as a tool. If that tool can help me write quality code faster then the better then that only makes me better. 

    Trey86, the popular AI right now is ChatGPT:  New chat (


  • that I have broken! It's a very good technology, still in training, but soon it will write some really cool stuff!, It already does a lot of good stuff,
    but still with errors that need to be corrected later in VBA! I recommend it for studies and to help as a virtual assistant. On our Channel I've been using it a lot to make texts and tags for the videos and of course, it needs a careful review and good commands, as accurate as possible! srsr Success there, I hope it helps you!