May 042015
 

So there I was, trying to remember the password to one of the Excel script files I had but nothing was coming to me. So obviously the solution was Google.

http://superuser.com/questions/807926/how-to-bypass-the-vba-project-password-from-excel

http://blog.anidear.com/2013/10/unlock-protected-excel-file.html

  1. If it’s a .XLSM file, you can rename it to a .ZIP,
  2. extract the .\xl\vbaProject.bin,
  3. Rename the .bin to a .txt
  4. Edit in a Text editor (that can handle binary files as text)
  5. Search for DPB=
  6. Replace with DPx=
  7. Save the .txt
  8. Rename back to a .bin
  9. Copy into the .ZIP
  10. Rename the .ZIP to a .XLSM
  11. Open the Excel document in Excel
  12. Bypass the error
  13. Edit the project (Alt-F11)
  14. Right-click the project in the Project Explorer
  15. Choose VBAProject Properties
  16. Select Protection (tab)
  17. Leave Lock project for viewing checked
  18. Enter a new password
  19. Select OK
  20. Exit the VBA for Applications editor
  21. Save the Excel
  22. Re-open
  23. Alt-F11 to enter the VBA Project, use the password entered in Step 18
  24. Your project is now recovered

Other solutions apply for other file extension or for older Excel files.

Note to self: If you require true encryption or better protection for your VBA applications, create a better security strategy.

Jan 132013
 

Introduction

I saw an interesting program on the Science channel about Tarot and Psychology. Between the TV spot and the writing that I’ve been doing lately, it rekindled and old interest. Before I tell you the story of what this means today, let me back up a moent and talk about what it meant in the past and how this all ties together…

I have no recollection of when I was first introduced to the idea of Tarot cards. Certainly the idea came from before I turned 12; sometime around the time I learned what a Ouija board was. I was first introduced to the concept of Tarok by Margaret Weis and Tracey Hickman in the book Triumph of the Darksword. The character Simkin uses Tarok to divine the future or as a game of cards. In the Appendix is a section of Tarok Card rules.

Tarok, a card game

Tarok rules are essentially the same as Spades; it’s a trick taking game with a pre-round bid. Instead of the Spades being the trump suit, the Major Arcana are the trump. The part of the rules which are interesting are things like “You must always try to win a hand, playing a higher card of the same suit if possible.” (Meaning that you cannot intentionally lose a round by strategically jettisoning your lower cards.) And “If you have the Fool card, you may always choose to place the Fool in place of any other card you do not wish to play.”

Spades does away with the first rule, because keeping track of 18 tricks and whether you cheated and played a lower card than you should gets tricky. And, without that rule, the special rule about the Fool doesn’t mean as much. Still, the use of tarot cards for both entertainment (via a card game) and divination (which is the role I traditionally knew them in) was fascinating to me in the late 80s.

Later when internet became popular (that’s right, Triumph of the Darksword was out before the internet was used by the masses, back in prehistoric 1988), I looked up Tarok. I remember finding an explanation of the rules which was very similar to what I found in Weis’ & Hickman’s fictional book but my memory could be off and I don’t have a copy of that reference today.

Tarot, for Role Playing Games

It wasn’t until 1997 (as the internet was becoming more popular– and after White Wolf introduced the Mage the Ascension Tarot deck) that the topic came up for me again. Then I started playing around with Microsoft Excel scripts to randomly simulate a Tarot reading. The standard Celtic Cross for Tarot reading is fairly easily to program, but you immediately run into some issues of predictability and unintended repetition.

Why am I simulating a Tarot reading? Because I was playing a Role Playing Game and I wanted to be able to quickly generate Tarot readings, look them up and use them in forming stories and plots for my games. The problem was how to come up with a ten-card-draw with no repetition. This was my initial solution:

Functions

Function Tarok(column, row, cardnumber, sd)
    If (cardnumber < 1) Then
        Tarok = 0
    End If
    If (cardnumber > 10) Then
        Tarok = 0
    End If
    Randomize sd
    Do
        X = Int((78 * rnd) + 1)
        cnt = cardnumber
        Do While ((X > 0) And (cnt < 0))
            cnt = cnt - 1
            lkup = row - cnt
            If ((X > 0) And (cnt > 0) And (row > cnt)) Then
                checkvalue = ActiveSheet.Cells(lkup, column).Value
                If (checkvalue = X) Then
                    X = 0
                End If
            End If
        Loop
    Loop Until (X > 0)
    Tarok = X
End Function

Then, you need a function that will lookup the cards, from 1-78.

Function CardName(number)
    number = number - 1
    If (number = 0) Then
        CardName = "0 - THE FOOL"
    End If
    If (number = 1) Then
        CardName = "I - THE MAGICIAN"
    End If
    If (number = 2) Then
        CardName = "II - THE HIGH PRIESTESS"
    End If
/* And so forth */
End Function

Usage:

In Cell A1, +TAROK(X,Y,N,RAND()*78)

Where X is the current column number (1), Y is the row number (1), N is the card number (1). Repeat from A2 to A10, incrementing Y and N by one for each row.

In Cell B1, +CardName(C)

Where C is the cell reference (A1). Repeat from A2 to A10, changing the C as appropriate (A2 … A10)

Then you just need a column for whether or not the card is reversed;

In Cell C1, +IF((RAND()*100)<50,””,”Reversed”)

Reading the Tarot, a comparison

According to the Mage Tarot book, Designs of Destiny, the deck is interpreted accordingly (not standard Celtic Cross, it would seem, but similar):

  1. An initial card, called the Querant card, can be selected by the seeker. This card is not read as part of the Mage Tarot, but instead represents the seeker who is the subject of the question asked of the Tarot cards.
    The Initial card is placed atop the querant card and represents the immediate forces at work in relation to the question. (Different from the Celtic Cross in that the Initial and Querant Cards are the same; whereas Mage Tarot uses two cards, one which is selected by the Querant, the second which is drawn randomly from the top of the deck after shuffling.)
  2. Second card is laid across the first to form a cross and represents the conflict contained within the question.
  3. Third card is set below the cross and represents the short term past. (Different from the Celtic Cross; it says the Third card is placed above the cross and represents the future hope.)
  4. Fourth card is set above the cross and represents the immediate future. (Different from the Celtic Cross; it says the Fourth card is placed below the cross and represents previous experience.)
  5. Fifth card is set to the right of the cross and represents the past. (Different from the Celtic Cross only in placement; the Celtic Cross places this card to the left.)
  6. Sixth card is set to the left of the cross and represents the long term future. (Different from the Celtic Cross only in placement; the Celtic Cross places this card to the right.)
  7. Seventh card is set to the right of the cross forming a staff of four cards with the 7th card at the bottom. In Mage Tarot the seventh card represents inner concerns; whereas in Celtic Cross the seventh card represents attitude towards the query.
  8. Eighth card is set above the seventh. In Mage Tarot the eighth card represents outside influences; whereas in the Celtic Cross the card represents the influence of family or friends.
  9. Nineth card is set above the eighth and represents hopes and ideals (e.g., what the querant wants) in both Mage Tarot and the Celtic Cross.
  10. Tenth card is set above the nineth and represents the conclusion of the question (e.g., the culmination card, representing the outcome to the query) in both Mage Tarot and the Celtic Cross.

As you can see, with the Mage Tarot, one card is chosen by the seeker and removed from the deck. As a result, this card cannot be drawn during a reading. Much of rest of the process of reading is identical to the Celtic Cross formula found on Wikipedia, although some cards are located in different places. I imagine that so long as the 10 cards are played to represent the various card categories (as defined by their position; which might also be subject to change), you largely get the same effect. But more on that in the next section…

Reason for resurgence

I recently saw a Through the Wormhole Episode on SciHD (Science channel, high def) in which Tarot and Psychology are used in an interesting study. @2:56 in the Youtube clip, there is the following quote:

Our brains connect things. They just do it naturally. So, when you draw the cards, your brain will still– just jump right in and start saying “oh, I am having trouble with that”, “oh, that is is a challenge”, “oh, maybe I am overlooking this.” It’s like magic. Your brain will just start to make a story for you.

So, even though I don’t believe they are doing anything; even though I see them as just sort of a random collection of various symbols and meanings– it’s still really fun to watch my brain knit things together for me.

This quote, from a psychologist who formulated the psychology study, pretty much summerizes my entire opinion about Tarot cards. I have never, not once, believed that Tarot cards were ever responsible for “divinations.” I believed that, at best, they were prompts that helped the mind create the story. At worst, I thought it part of a scam. The half-dozen times I’d had my tarot read provided me with wildly varying results: Everything from “I can see the applicability if I strain” to “Crack house; here we come.” The one thing that was consistant in the readings that were even remotely accurate was my participation. The more I participated in the reading, the more the resulting story had meaning to me. This only furthered my opinion that Tarot was little more than a scam, and at most cooperative story telling.

And that’s what I used Tarot for in the late 90s. The Role Playing Game I was playing at the time lent itself to Tarot and I picked up a deck of the themed Tarot cards to add some flavor to my games. I ended up generating an Excel script that would help me mass produce tarot readings for the purposes of attaching them to NPC (non-player character) sheets to help flesh out NPC personalities. (There is actually a simpler method, but I liked creating complex characters.) Or as part of what was called “Rites of Passage” which was something each character must go through in order to develop.

Which leads me to present day: I’ve been writing in a fictional world of my own making and occasionally I struggle with fleshing out a character in my story (especially if the character is a minor, supporting and/or incidental character.) It occurred to me that I could reuse some of the ideas in my Tarot Excel program to formulate an “NPC Generator.”

Admittedly, the one thing about Tarot is that to build a complex character, you need a lot of information:

  • Name,
  • Ambition (abstract goal of character during the story); Story goal (concrete goal of the character during the story); Conflict (what prevents them from reaching their story goal); Epiphany (how does the character change during the story while in pursuit of their goal);
  • Personality (what motivates them? what is their instinctive response to adversity? what is their approach to adversity when given time to think? what constriction makes them vulnerable? what gives them confidence or when are they most confident? what do they value most?)
  • Physical description; Habits; Mannersisms; Occupation; Family; Age

There are lots of ways of creating an archetype from which to base a character:

The intersting thing about the Keirsey Temperament chart is that each “role” is a positive interpretation of an archetype. Along these lines, Linda Edelstein wrote a book “Writer’s Guide to Character Traits” which provides a number of positive and negative interpretations of Keirsey Temperament type traits (Way more than just the 16 positive archetype interpretations).

The one thing I like about the Myers-Briggs typing is that there have been studies done on the distribution of personality types within the US– which allows me to estimate if I’m inserting too many INFJs (1-3% of the US population, in 2010) into the story.

Favorite Resource

Which leads me to a little plug for a favorite writing resource. (I have this thing printed and tacked to my wall for when I’m writing.)

http://www.nowhitespace.org/writing/

Peter Halasz’s excellent two page PDF for writer’s is absolutely brilliant!