I apologize for the question that seems to be quite simple but for which I haven't been able to find an answer online.
I am interested in retrieving variables' names and values that were used before Excel crashes.
According to Write contents of immediate window to a text file it is possible to write a log to a text file. According to reading and writing a csv file using FileSystemObject it is also possible to create a CSV file
Suppose that at one point myVariable = "Hello" and then later in the macro myVariable = "World"
My question is:
How can I format this log as a two column table where the first column would be the list of the names of the variables that have been specified (here myVariable) and the second column would only be the latest value of the variables in use (here "World"). The rows of the table would be incremented as new variables are defined and the second column of the table would be overwritten as the values of those variables change.