Jonathan-LeRoux / IguanaTex

A PowerPoint add-in allowing you to insert LaTeX equations into PowerPoint presentations on Windows and Mac
http://www.jonathanleroux.org/software/iguanatex/
Other
852 stars 59 forks source link

Run-time error '432': File name or class name not found during Automation operation #6

Closed q00u closed 5 years ago

q00u commented 5 years ago

Google Groups is down, deleting all replies and new posts. The story so far:

Microsoft Visual Basic error. Happens when I click "Generate".

Can only 'End' ('Continue' and 'Debug' buttons are disabled)

This is on a fresh install of: Latest IguanaTex 1.56 Latest TexLive Latest ghostscript 9.26 Latest ImageMagick 7.0.8 Latest TexStudio 2.12.14 Latest TeXimg 2.1.0

IguanaTex settings pointing to correct paths of above programs.

PowerPoint is from Office 365, semi-annual channel, up to date.

OS is Windows 7, up to date.

'latex' successfully runs from a command window

No temp files appear in C:\Temp

With the pptm I can Debug (on Edit), which gets me to the subroutine in macros:

Sub DeDuplicateShapeNamesInSlide(SlideIndex As Integer)

Specifically the line: If Not dict.Exists(Key) Then

Replacing Dim dict As New Scripting.Dictionary with

Dim dict As Scripting.Dictionary
Set dict = GetObject( , "Scripting.Dictionary")

moves the error to the Set dict line.

With the pptm I can Debug (on Generate), which gets me to:

Private Sub WriteLaTeX2File(TempPath As String, FilePrefix As String)
    Const ForReading = 1, ForWriting = 2, ForAppending = 3
    Set fs = CreateObject("Scripting.FileSystemObject")

(Error on last line)

Have confirmed Microsoft Scripting Runtime enabled in references 2019-03-13 10_23_41-References - VBAProject

Though it points to my documents folder instead of the dll?

Have tried disabling, re-enabling, adding dll directly (conflicts with existing), removing and adding the reference in code (both system32 and syswow64 versions) but nothing fixed it.

Jonathan-LeRoux commented 5 years ago

On the off chance: could it be that you are having a conflict between 64 bit OS and 32 bit Office?

The issue with the scripting runtime pointing to the document folder is exactly what is reported in the post I had mentioned: https://stackoverflow.com/questions/47599416/excel-vba-createobject-run-time-error-432-file-name-or-class-not-found-durin

Have you tried registering C:\Windows\system32\scrrun.dll or C:\Windows\SysWOW64\scrrun.dll as follows, in an elevated command prompt: cd C:\Windows\SysWOW64 regsvr32 scrrun.dll Then check in the VBA reference that the Microsoft scripting runtime is now indeed pointing to that .dll.

On my Windows 8.1 machine, the scripting runtime is pointing to C:\Windows\system32\scrrun.dll.

q00u commented 5 years ago

Success! It's 100% working now. Thank you!

Your correct solution was so much faster to implement than all of my failed attempts! It feels like the joke about the expert knowing which pipe to tap.

Jonathan-LeRoux commented 5 years ago

Great! So the registering with regsvr32 did it? Which version of scrrun.dll did you pick?

q00u commented 5 years ago

The one in SysWOW64 exactly as you suggested. I would have tried System32 if the first one failed, but it worked!

(Of course then I had to setup TeX2img which I didn't know I had to run outside of IguanaTeX first)

Jonathan-LeRoux commented 5 years ago

Perfect, thanks for confirming.