8

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.

JAtterton
  • 83
  • 1
  • 4
  • Same thing happened to me just today. – rory.ap Jul 13 '17 at 19:53
  • 6
    I also have this problem. I found alternative code for GUID generation here, which doesn't use scriplet.typelib (and avoids having to roll back the update): [http://www.cpearson.com/excel/CreateGUID.aspx](http://www.cpearson.com/excel/CreateGUID.aspx) Appears to work fine. Any reason not to use that? – Alex Bloom Jul 14 '17 at 09:03
  • @AlexBloom, this alternative is not working in Office 2013 – juanmah Sep 19 '17 at 09:08
  • See Support MS article https://support.microsoft.com/en-au/help/4036837/run-time-error-70-permission-denied-generate-guid-with-office-vba (Last Updated: 15 Aug '17) – T.M. Mar 03 '18 at 12:10

3 Answers3

2

The KB3213624 seems to be the Office 2010 Security Update. Below are the KBs for other versions of MS Office:

Microsoft Office 2013 Service Pack 1 (64-bit editions)      3213555 
Microsoft Office 2013 Service Pack 1 (32-bit editions)      3213555 
Microsoft Office 2007 Service Pack 3                        3213640
Microsoft Office 2016 (32-bit edition)                      3213545
Microsoft Office 2010 Service Pack 2 (32-bit editions)      3213624 
Microsoft Office 2010 Service Pack 2 (64-bit editions)      3213624
Microsoft Office 2013 RT Service Pack 1                     3213555
Microsoft Office 2016 (64-bit edition)                      3213545
tony722
  • 1,985
  • 2
  • 15
  • 14
0

We've now resolved our issue.

It was caused by updates, apparently. After rolling back the last batch of updates on all 'broken' machines we now have 4 'working' machines.

JAtterton
  • 83
  • 1
  • 4
  • what are you going to do when windows 10 resintstalls that update? I have this same problem, but I'm afraid i'm going to end up in a cycle of rolling back updates every time windows decides to reinstall it. – am21 Jul 17 '17 at 12:33
0

We ran into this problem this morning too.

Delete Windows update KB3213624. That solved the error.