VBA and ChatGPT

At this point, ChatGPT is not particularly threatening. It can't do anything out in the real world - yet. I am doing a big project in Python and SQL Server. Chat writes code and uses an almost comical variety of ways to get that code to me. Sometimes it places it in a .Py file and presents it to me to download. Sometimes it writes the code directly in the chat window, usually but not always in a "canvas" - with comments about why it is doing whatever it is doing. Sometimes it is a line or two, sometimes it is an entire .py file. Sometimes it places the comments in the chat window and opens a big canvas and places the code there. Sometimes it sloooooowwwwwwllllllyyyyy overwrites everything in the canvas in order to place some new code at the bottom.

It is damned annoying actually. Some of the time it asks if I want it to place it all into a py file and present it.

I have written a "coding standards" document which I was presenting to chat before every session. I discovered that because that is short it can just be placed into the project instructions window. I also had Chat generate Metadata stored procedures which I can run to get table / field / data type / index information.

This by the way is absolutely critical to give back to Chat. Even though Chat (mostly) provides me scripts to build out these things, once a chat session ends, it "forgets" the names of things. It then starts "making up" table and field names, which mostly appear that they are correct, until I try to run the next piece of the puzzle - often in python scripts trying to use these tables. Whereupon his made up names cause errors. I have learned to just run the metadata SP, get (scrape) the metadata out of SQL Server, and paste it into the chat and voila... chat acknowledges his errors and starts using the metadata.

It is so bad that this is part of my coding standards instructions:

Python Coding Standards​

  • At the top of every Py script I need a full explanation of what the script does.
  • Add print functions at the top, the very bottom and inside every loop until we are fully debugged
  • Wrap all database access in try/except blocks with full traceback.
  • Hard-stop on core logic errors using sys.exit(1) or raise SystemExit.
  • Catch and skip expected errors like duplicate key violations using error codes.
  • Batch process records when possible instead of row-by-row.
  • Use joblib or pickle to save/load model files in a dedicated models directory.
  • Use logging for status, errors, and progress — not just print().

SQL Server Standards​

Never do something without knowing the metadata

  • sp_GetMetadataWithPurpose to get the existing table metadata.
  • Never guess. Verify actual table and field names before writing queries — never guess.
  • Use sp_addextendedproperty to document tables, fields, and indexes. If you build something, DOCUMENT IT, right then and there. Add a purpose property to anything new, whether table, field or index.
  • Always include a table-level description using SQL extended properties.
  • Views and stored procedures must be commented before the AS block.
  • Use clear, consistent naming conventions for all objects.

BTW there is a somewhat limited amount of text that can go in there.

From Chat:

The project “instructions” window (also called the system message or model instructions) can hold approximately:
32,000 characters (32 KB)
That includes:
  • Your custom coding standards
  • Metadata like project goals, preferences, and schema notes
  • All system instructions loaded into the session at startup

As Chat intimates, I paste a handful of documents in there. The contents, not the documents themselves. The problem is that the documents change and I have to occasionally go in and edit that memory area. But... once they are in that area, Chat (mostly) actually uses these things. And when it doesn't I can simply ask... "Did you use the metadata" or something similar.
 
Well, my understanding is that Chat can now open a (virtual) browser inside of the chat environment and do stuff in that browser out in the world. As for writing a file to disk, I just had chat swear up and down it had written a python script to a valid path on my disk. In the end I did a screen shot of the dir with no such file visible and pasted it back in to Chat, whereupon it said... "oh yea, that was in my head". It appears to actually have an (virtual) environment and can run python etc in that environment. But to have me run that script in the real world it had to provide me a download link. I downloaded it (to my download dir), moved it where it actually belong and ran it from there.

I am doing this for the last many weeks and have never seen it able to do anything on my computer.
 
First, Chatty is a she...

Second, I agree; Even though programming actually encourages plagiarism, one should give credit to any and all sources that were used.
LOL, I call chatty Winsome Winch with the British accent, or Winnie for short. I use advanced voice mode on my phone, and chose that voice to interact with. "She" seems to "enjoy" that little exchange when I open a chat that way.

And where am I going to get the bajillion sources that has been scraped and inserted into the model?
 
LOL, and where am I going to get the bajillion sources that has been scraped and inserted into the mo
del?
Well, in your case, Ive had a little change of heart from what others have said.

In my own personal experiences, Ive made installation/FE updaters Powershell Scripts.

I didnt know SQUAT about PS so I had to employ ChatGPT to do all the heavy lifting. In the comment section, I made sure anyone looking at the code knew that John Clarks contibution was concept and testing.

No judgment here, just a quirk of mine
 
BTW I have been interacting with "Sir Chat" and it has integrated a lot of our interactions into some pretty humerus exchanges. I told it I was giving it the title Sir Chat in honor of it's service to me. And I routinely tell it "Make it so Number One" and it provides a ton of star trek references in response. Dilithium crystals melting down, shields failing etc.

It is kinda fun actually. It is easy to see how a person with mental health issues could mistake this for reality.

Ohh... that's me???
 
Well, in your case, Ive had a little change of heart from what others have said.

In my own personal experiences, Ive made installation/FE updaters Powershell Scripts.

I didnt know SQUAT about PS so I had to employ ChatGPT to do all the heavy lifting. In the comment section, I made sure anyone looking at the code knew that John Clarks contibution was concept and testing.

No judgment here, just a quirk of mine
And that's OK. I have been working with Chat for at least a month. I started using it to help me write some vba stuff for my book. It was when I realized how much depth it had in its coding abilities that I suddenly thought about other uses for it, other projects I wanted to work on. I have now worked on a Python / SQL Server project that I tried to do a couple of years ago, where I needed to learn Python in depth. And it just never happened. My project was just too large for my limited skills in Python. Back then I had never even heard of ChatGPT.

This time around, having 'discovered' chat, I just told Chat to "act as a programmer" (which BTW is what one is supposed to do to make it approach whatever you are doing in a specific manner). I described my project in English language, in extreme depth, and it started writing code. It was quite the learning experience on my end, as I have described already. But I am now halfway up to speed on ramrodding Chat and my project is taking shape. I'm telling you, I have stuff done that it would have taken years of learning on my part to make happen.

AFAIAC it is my project. I am the owner. I am building a company essentially. Chat will build the app, but the ideas are mine. Chat will write a business plan but the ideas are mine. Chat will write a proposal but the ideas are mine. Chat is not a person it is a computer program. I would not give acknowledgement to Microsoft when I write in the C# interpreter or Turbo Pascal. I am writing code in the English language in Chat. I pay the $20 monthly fee and it is mine to do with as I can.
 
Last edited:
My daughter is 22 years old but operates at a 3rd grade level due to her intellectual disabilities. I asked Chat (Winnie on my phone) to act as an author. I described how I want to write a book that Allie can read, about fictitious adventures she has out in the world with her dog Sadie and her Brother's cat Puuuursephony. I talk to Winnie. I describe places that Allie and I go, things she likes to do, how she loves to fish, how she gets the hook out of the fish on her own, how she loves to go to specific campgrounds etc.

So I feed Winnie ideas about each chapter and Winnie writes short chapters for the book. My instructions to Winnie is to write in a style appropriate for her working level. I want her to be able to read the book. So far Winnie and I have 6 little chapters written. I am trying to use ComfyUI to create little cartoonish pictures to put at the top of each chapter, showing some thing happening in that little chapter. When I described that to Sir Chat he "offered" to write the text descriptions or prompts to get ComfyUI to build a picture for each chapter. I uploaded the book to him ((S)he had actually written most of the text) and (s)he wrote little text prompts to feed into ComfyUI to generate a little picture for each chapter.

Now it is helping me get ComfyUI figured out again. I was generating pictures a year ago but I forgot how to use it...

Chat is amazing what it can do for us.
 
I asked Chat (Winnie on my phone) to act as an author. I described how I want to write a book that Allie can read, about fictitious adventures she has out in the world with her dog Sadie and her Brother's cat Puuuursephony.
:love:
 
“A motorhome parked next to a forest creek, an early teen girl, short blond hair, with her chocolate labradoodle and fluffy gray cat discovering a treasure map under a rock. Rain clouds above, but warm light from the RV windows. Cozy cartoon scene, adventurous and magical.”

1753756774246.png
 
We had an interesting conversation last night following John's presentation on VBA and ChatGPT.

For me, the main take-away at this point, subject to having time to review the recording, was the importance of developing a strategy for creating effective prompts to guide the AI assistant you acquire. That is followed closely by the importance of being persistent and diligent about testing and validating responses prior to deployment.

The role of the AI assisted developer needs to be clearly defined and understood to be effective And the role of the AI assistant must also be clearly defined and understood.

I generally like the idea of incorporating a responsible AI assistant as a key role in most development projects.
 
I am using the new ChatGPT 5 and boy is it not an improvement. It takes three times as long to process my admittedly complicated requests. but then it flat ignores my prompts.

The way I worked in the past was to upload several documents to chat to "hydrate" it (chat's terminology) with needed stuff to understand what we are doing. Things like a metadata dump of the tables and fields from SQL Server, an ODT document with what the project is and specifically what we are doing, a coding standards etc etc. This before even entering my first prompt. And so I did that. However I wanted to do some housekeeping and so my prompt was to have chat do XYZ for me.

Yea... no!!! It was as if it hadn't even read the prompt. It launched into how cool what we had done was (true), and how it could improve this thing and that thing and... several pages of that. Not a word in there anywhere about the prompt I just entered.

Anyway it took me a half hour to wrestle it back onto what I wanted. I actually had to enter prompts specifically saying that it had not answered my previous prompt and THEN it answered that prompt. WEIRD!!! But when it asked if I wanted it to do something related to what I had asked for, and I said yes, it launched back into what it could do to change this thing or that thing. Totally ignored my latest prompt.

This is continuing. I am slowly getting stuff done but only by steering it pointedly back to my last input prompt.

HUGE BUG I THINK

And no way to roll back to ChatGPT 4.
 
Last edited:
I am using the new ChatGPT 5 and boy is it not an improvement. It takes three times as long to process my admittedly complicated requests. but then it flat ignores my prompts.

The way I worked in the past was to upload several documents to chat to "hydrate" it (chat's terminology) with needed stuff to understand what we are doing. Things like a metadata dump of the tables and fields from SQL Server, an ODT document with what the project is and specifically what we are doing, a coding standards etc etc. This before even entering my first prompt. And so I did that. However I wanted to do some housekeeping and so my prompt was to have chat do XYZ for me.

Yea... no!!! It was as if it hadn't even read the prompt. It launched into how cool what we had done was (true), and how it could improve this thing and that thing and... several pages of that. Not a word in there anywhere about the prompt I just entered.

Anyway it took me a half hour to wrestle it back onto what I wanted. I actually had to enter prompts specifically saying that it had not answered my previous prompt and THEN it answered that prompt. WEIRD!!! But when it asked if I wanted it to do something related to what I had asked for, and I said yes, it launched back into what it could do to change this thing or that thing. Totally ignored my latest prompt.

This is continuing. I am slowly getting stuff done but only by steering it pointedly back to my last input prompt.

HUGE BUG I THINK

And no way to roll back to GhatGPT4.
100% agree. I've been waiting for nearly 3 1/5 hours for a report. It is very extensive and ambitious, I know, but ChatGPT 5 has told me "another 15-30 minutes" for 2 hours now. I'm not sure if this particular request is really all that complex, or if it's just gone brain dead in the transition.
 
And... the new limitations are potentially huge. 80 exchanges in 3 hours for the $20 / month version. I am spending all my prompts just trying ti get it to do something useful.
 
Just clarified: For the GPT-5 model on ChatGPT Plus, OpenAI does not publish an explicit message-per-day cap. Instead, they use rolling windows—typically allowing several dozen messages per a few-hour period based on the model and current load.

So:
  • No fixed daily limit on GPT-5 usage.
  • Instead, there’s a rolling hourly/3-hour cap that refreshes over time.
  • Voice conversation uses the same message budget—and is also constrained by session duration (around 15 minutes).
These caps can adjust if usage surges occur.
 
The day of your presentation I was trying to add a 2 command to my multiselect treeview form. First to show only those nodes with the check box checked, then back to show all nodes. Microsoft common controls treeview controls have a visible property that can be set true or false, making it look easy, except the property has no affect on the tree. It required deleting the un-check nodes then restoring them. Saving nodes to a collection before deleting handled the hide but I was having trouble restoring them in the same order. The solution was to copy the entire tree to a collection then restore the tree when needed.

After the presentation I tried Copilot, It took a few attempts with debugging to get a working solution. I posted it in sample databases. My come away is that Copilot code will often reference properties that don't exist or not compile, but after informing Copilot of the error and the line of code it helped me get to a working function which I then cleaned up and added error trapping.

Being as I had some time I used Copilot to help me with positioning the form. It gave me functions to give me the height of the tool bar and border of the parent form.
 
The thing about AI is that while it knows "everything" it often knows things that aren't real. :D:eek:
 
100% agree. I've been waiting for nearly 3 1/5 hours for a report. It is very extensive and ambitious, I know, but ChatGPT 5 has told me "another 15-30 minutes" for 2 hours now. I'm not sure if this particular request is really all that complex, or if it's just gone brain dead in the transition.
Did you ever get your report?
 

Users who are viewing this thread

Back
Top Bottom