I have a problem with my code which seems to have cropped up over night. There are some peculiarities with this so I'll try to give as much detail as I can.
The file in question is an excel workbook which generates an xml file from data passed in. The file is opened, populated and saved via a macro, and this section runs fine.
The problem occurs when creating a GUID for the .xml, in this routine:
Function GenGUID() As String
Dim strGUID As String
Dim TypeLib As Object
Set TypeLib = CreateObject("Scriptlet.TypeLib")
strGUID = TypeLib.guid
'dump the curly brackets
strGUID = Replace(strGUID, "{", "")
strGUID = Replace(strGUID, "}", "")
strGUID = Left(strGUID, Len(strGUID) - 2)
GenGUID = strGUID
End Function
Specifically, the line:
Set TypeLib = CreateObject("Scriptlet.TypeLib")
This throws up a "Runtime error 70: Permission Denied".
Now, the peculiarities.
- Out of 4 machines the file was tried on, it works on one of them.
- The user of the 'working' machine has tried running the file on the other 3 machines to no avail.
- Of the 3 'broken' machines, 2 had updates installed overnight and the other hadn't had updates installed in a few days. The 'working' machine hasn't had updates installed since February.
- The administrator account has tried running the file to rule out an overnight permissions update.
- The file ran fine yesterday (12th Jul 2017) on one of the 'broken' machines.
- All reference libraries have been checked and they match with the 'working' machine.
- The Excel version in use on all 4 machines is 2013 Pro.
The stand out above is the updates issue. But, the machine the file ran fine on yesterday was the 'broken' machine not updated overnight, ruling this out.
We have tried everything we can think of, along with a lot of internet trawling for answers. All coming up with nothing.
Does anyone have any ideas?
Thanks in advance for any help.