ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code suddenly won't run on XL2002 (https://www.excelbanter.com/excel-programming/296386-code-suddenly-wont-run-xl2002.html)

Mark Tangard[_2_]

Code suddenly won't run on XL2002
 
Our office uses XL infrequently. We run XL 2000 on all machines except
one, which runs 2002. All machines run WinXP Pro, and nicely. Until
today all of them obediently ran the below code, which looks for the
alphabetically "highest" file in a given folder and opens it.

Sub Workbook_Open()
Dim TimesheetFolder As String
TimesheetFolder = "C:\TS"
With Application.FileSearch
.NewSearch
.LookIn = TimesheetFolder
.SearchSubFolders = False
.Filename = Application.UserName & " ??-??*" & "*.XLS"
If .Execute() 0 Then
Workbooks.Open .FoundFiles(.FoundFiles.Count)
End If
End With

[Error checking code is removed for clarity.]

This code is run from an shortcut icon on the Quick Launch bar that
points to the containing XL file, which is why it's in a Workbook_Open
event. It means one click brings up the user's current timesheet. They
like that a lot.

Today the 2002 machine won't run the code, unless it's run from an VBA
add-in (code assigned to an XL menu or button). Attempting to use the
Quick Launch button hangs XL immediately. No error message except
during later attempts in the same Windows session that warn it caused a
"serious problem" last time it was opened. Obviously, duh, this means
it's security-related. Humor me, wise ones. I'm "sure" (!) nothing has
changed on that PC -- except of course, that something obviously has!

To make it run in the first place (months ago) without a macro warning,
I had self-signed each PC's copy of the file via SelfCert. Note: I
*didn't* copy a signed file from one PC to the next; I did each on its
own machine. This was October, and it worked fine until today.
Suspecting a plotzed certificate, I tried to make another. Error
message: "Could not create a certificate." Whaa?

The affected user really wants her one-click access back. Now she has
to open XL first. Doesn't sound so horrible, but the 3 clicks and a
wait are irking her badly. Any clues very deeply appreciated.

--
Mark Tangard, Microsoft Word MVP
"Life is nothing if you're not obsessed." --John Waters



All times are GMT +1. The time now is 10:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com