Macros and Programming


CardboxForumsMacros and Programming > "Startup macro problem"

Startup macro problem

The macro that should start with Cardbox cannot be found, yet plays OK from Window

Current user: [none]
Register / Log In · Help

Posted By Post


12-Feb-2015 13:00

As per the guide, I placed a macro in the "This Database" section, and it plays OK. It's named "StartUp" So I went to Tools->Options and the Start tab, and selected the top option so that the macro is only associated with this Workspace, (overwriting existing file?)Don't want to use "General" as it only applies to this workspace / database.

Upon loading, the program =tries= to run macro, but simply says the "StartUp" macro cannot be found. My understanding is that if it's listed in the macro editor, all I need specify is the macro name in the Start field

Interestingly, the path to workspace / general macros on the "Macros" tab is shown as "C:\Users\Chris Brown\Documents\Cardbox" ...but no such folder exists! (Nearest is "My Documents" which contains a file called "Cardbox.cbw") so I'm mystified as to where the macros are hiding. Or is this Microsoft shorthand for the same folder, and macros are encoded in the cbw file?

Just for an experiment, I edited the macro before playing manually, but didn't quote any path when I ran it. The script ran, and reported OK ... but I couldn't trace the folders!! (My theory was that if I found the generic/default/base folder, I could dispense with having to enter the BasePath which will vary from user to user)

Dim hot,prints,arc,thumb,base,out,x
Set fso = CreateObject("Scripting.FileSystemObject")

BasePath="C:\Users\Chris Brown\Desktop\PhotoBooth\"
'Basepath="" My experimental line

hot = "Hot"
prints = "Prints"
arc = "Archive"
If Not fso.FolderExists(BasePath & hot) Then fso.CreateFolder BasePath &hot
If Not fso.FolderExists(Basepath & prints) Then fso.CreateFolder BasePath &prints
If Not fso.FolderExists(BasePath & arc) Then fso.CreateFolder BasePath &arc
If Not fso.FolderExists(BasePath & thumb) Then fso.CreateFolder BasePath &thumb
If NOT fso.FolderExists(BasePath & reprint) Then fso.CreateFolder BasePath &reprint

MsgBox("All done") 'Only here to check program has run


12-Feb-2015 16:31

startup macro: you can place it in the room for (related)database macros, workspace macros, as well as the room for general macro's.
If you place it somewhere else then you have to enter full path of the macro d:\folder\macroxyz.cbs. As far as I know, this is not documented.

Quick Reply

Please log in or register before trying to post a reply.

© 2010 Cardbox Software Limited   Home