Microsoft Office (Excel) Helpfulness Snarl Rant
-
Renaming the extension to .xls didn't work, nor did .xslx. I deleted the file and started over.
-
My solution: GUIDs.
Each workbook would have a GUID that's generated by Excel when the file is first created; when referencing another workbook, the link is done on the GUID.
What happens when a workbook is copied? Does it get a new GUID? If so, how?
-
Bottom line is that I think it throws away your nice new name and goes back to the old name when it re-displays the file chooser again.
Yes. If you close the dialog box--I'm speaking here of the standard Windows File Save As one--with the cancel button, Windows does NOT tell you the file name that was last in the text box, so your changes are lost. You can whip up a quick test in like 5 minutes with GetSaveFileName and see, which is what I did.
-
Well, I don't remember in detail, but I think "cute" (gag) may have had something to do with his being discarded after 3 seconds.
I am deeply disappointed you or anyone else didn't respond to my completely off-the-cuff "clipshit", which I thought was rather clever.
-
Each workbook would have a GUID that's generated by Excel when the file is first created; when referencing another workbook, the link is done on the GUID. To make it easier to use, that GUID can be wrapped in an interfacing object.
I wonder if that could survive being persisted through CSV format. (I don't know if an external link in general can, but adding metadata would be less likely to.)
-
Do it like almost any other programming language in the world does it: file paths. If you reference a file using only the name, it should assume a relative path and thus use the file in the directory of the running VB
-
I wonder if that could survive being persisted through CSV format.
Nope. But then most Excel features aren't persisted through CSV anyway.
@flabdablet said:What happens when a workbook is copied? Does it get a new GUID? If so, how?
…shit.Back to this, I guess:
-
-
Back to this, I guess
The real question is why you find Excel's workbook naming and linking convention to be problematic in the first place. In fact an Excel workbook name is a GUID, or at least functionally equivalent to one.
There's a standard filesystem rule that says no two files in the same directory can have the same name. That rule will never be violated if all filenames are globally unique, so it's perfectly safe for Excel to use its workbooks' names directly to name the files it saves them in. However, that doesn't necessarily mean it's perfectly safe for the user to chose some arbitrary set of filenames and use those as Excel workbook names, because doing so opens the possibility of violating Excel's visible-name uniqueness requirement as soon as you start working with multiple directories.
You are perfectly free to use standard-format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} text GUIDs as Excel workbook names, if that pleases you. That lets you set up inter-workbook links completely unambiguously, and you won't ever break any filesystem rules. Plus, knowing that GUIDs are supposed to be unique will remind you that Excel's inability to deal with ambiguous workbook names is not actually a problem as such; probably rates closer to a quirk.
But raw GUIDs are so ugly, I hear you howl! Yes, indeed they are. And that's why God invented Windows shortcuts. Now go, and sin no more.
-
didn't respond to my completely off-the-cuff "clipshit"
You got a what more do you want?
-
You are perfectly free to use standard-format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} text GUIDs as Excel workbook names, if that pleases you. That lets you set up inter-workbook links completely unambiguously, and you won't ever break any filesystem rules. Plus, knowing that GUIDs are supposed to be unique will remind you that Excel's inability to deal with ambiguous workbook names is not actually a problem as such; probably rates closer to a quirk.
Wow. That's a good thing to know. From now on, I'm naming all of my documents
{6afa9789-95a0-4c80-94b6-d7a65cd7aac8}.xslx
.
-
Here's a bookmarklet for you.
javascript:alert('{88888888-8888-4888-2888-888888888888}'.replace(/[82]/g,function(c){return(Math.random()*c*2^8).toString(16)}))
-
Can't wait for some poor bastard to try and work with those files inbash
...Huh. It didn't complain. Interesting.
-
Wait, you mean I'm not the only person who puts the start bar at the top? Do you also auto-hide it?
The top? Oh, heavens, no. Left edge of primary, and no autohide. Seeing it flicker when I mouse over to the left-side auxiliary screen would annoy me. (Although to be fair, my lxpanel on my home machine is at the top of a monitor.)
-
-
javascript:alert('{88888888-8888-4888-2888-888888888888}'.replace(/[82]/g,function(c){return(Math.random()c2^8).toString(16)}))
Pasting that into the Chrome address bar removes the javascript: prefix, resulting in a Google search. WTF Chrome?
-
WTF Chrome?
security feature. you need to make that a bookmarket for that to work in chrome.
-
I guessed it would be to save little script kiddies from blindly copy pasting scriptlets they've found in AOL Chat, or Myspace or whatever they're on these days. Doesn't stop them from being told to paste the same code in the console or whatever though.
you need to make that a bookmarket for that to work in chrome
Or manually re add the javascript:. It's on the paste, not the go
-
Doesn't stop them from being told to paste the same code in the console or whatever though.
Sure it does. You need to hand-type "allow pasting" after seeing a big scary warning about how it will eat your soul if you do.
-
Doesn't stop them from being told to paste the same code in the console or whatever though.
i'm waiting for chrome to do what firefox does with that. you can't paste into the console in firefox at first. if you try it shows you a scary warning and then tells you to go twiddle a certain thing (i forget what) if you actually want to paste that javascript anyway.
once you've twiddleed that thing you can paste until you restart firefox.
-
if you try it shows you a scary warning and then tells you to go twiddle a certain thing
It actually asks you to typeallow pasting
IIRC
-
oh. so they already added that. ;-)
-
No, I mean that's what Firefox does; Chrome doesn't have that yet
-
oh.
/me resumes waiting for chrome to
stealimplement that
-
The top? Oh, heavens, no. Left edge of primary, and no autohide. Seeing it flicker when I mouse over to the left-side auxiliary screen would annoy me. (Although to be fair, my lxpanel on my home machine is at the top of a monitor.)
Weirdo.
-