I believe this issue is a result of a recent update to MS Office/Access or Windows 10. When I run this code:
Dim s As String
With CreateObject("Scriptlet.TypeLib")
s = Left(.Guid, 9)
newguidx = Right(s, 8)
End With
I get an error: Permission Denied on the With Statement. This is new only only cropped up after my admins updated our systems. I have no option to roll back updates. Anyone come across this and have a work around?
OS: Windows 7 Enterprise Access Version: 2010
Thanks
From Microsoft:
In Access, we can suffice with this very short function to generate a GUID by leveraging
Application.StringFromGUID
to cast bytes to a GUID. It generates pretty verbose GUIDs, though, with the format{guid {00000000-0000-0000-0000-000000000000}}
.You can strip away unwanted characters, for example by replacing the last line of this function with
NewGUID = Mid(Application.StringFromGUID(b), 8, 36)
. Then, the format will be00000000-0000-0000-0000-000000000000
Since windows update taken out "Scriptlet.TypeLib", try the following:-
Alternatively, if you are connecting to SQL Server 2008 or higher, try to use the SQL NEWID() function instead.