Closed wangfh5 closed 4 months ago
Thanks for reporting. Could you specify at which stage the error occurs? To do so, please check the Debug button, so that processing will stop at each step. I don't think I'll be able to debug this, but maybe @tsung-ju will have an idea.
Based on the step-by-step debug mode, I passed "LaTeX to DVI" and "Cropping PDF", and then the error occurred at the step of "Insert image".
If you feel like it; could you download the .pptm, open it, trigger the bug, then click "Debug"? This should tell you which line raised the bug. Note that you will likely see 2 IguanaTex tabs, one for the loaded add-in and the other for the .pptm. If the "Debug" button is disabled as in your picture above, try the other tab. The other more involved option is to open the VBA editor (Tools>Macros>Visual Basic editor), place a breakpoint at this line by clicking in the margin, and then use the function as you've been doing. The process will stop at the line, and you then Step Over (⇧⌘O) until you hit the bug. If that's on a line calling another function, you can run again and then Step Into (⇧⌘I) when you reach that line.
As you see in the figure above, the "Debug" button is in gray and can not be clicked.
I tried the breakpoint test. After many ⇧⌘O, the overflow error happened and I clicked "Debug" button (inside the VBE, it is not in gray). And then it jumped to this line: I'm not sure whether this line cause the error since it seems that clicking "Debug" button could skip the error line. Anyway, it should be a close place. And then after many ⇧⌘O, I sucessfully inserted the image.
Thanks! I'm a bit surprised you were able to insert the image in the end. Could you place the breakpoint at that line and run again? Then step over, so that we can make sure it's indeed this line that triggers the overflow. Does PowerPoint then let you continue once you hit debug?
If it's indeed that line, I'm tempted to say it's an Office bug.
Yes, further testing shows that this line indeed triggers the overflow.
Does PowerPoint then let you continue once you hit debug?
Yes. After I click the "Debug" button, PowerPoint lets me continue to the next line, and then the image gets inserted.
If it's indeed that line, I'm tempted to say it's an Office bug.
I hope that Microsoft will fix it during the macOS 15.0 beta time.
Thanks a lot for your testing, I really appreciate it. Maybe one last thing you could see is what values the posX/posY input variables to the .AddPicture method are taking. I doubt they're problematic, but it's worth checking. If you could report the issue to Microsoft, that would be fantastic. There's a way to do it within PowerPoint.
In the meantime, you could try to ignore the error with something like: On Error Resume Next
If Err.Number = 6 Then
#Repeat the same AddPicture line here#
Err.Clear
End If
Totally untested 😅
Thanks for your advice. I asked ChatGPT to help me handle the overflow error and changed the function to
Accidentally, after that, another overflow error happened before the above function call. They are just some assignment to values, so I totally do not understand why. However, I just asked ChatGPT to help me handle the error and changed it to
These two modifications make the image insertion successful. I save the .pptm
file and export it to a .ppam
addin. If anyone meets the same problem, these files may be a temporary choice.
IguanaTex_v1_61_wfh.zip
Given that you are the only one having reported this issue, and it's likely a Microsoft bug, I will close the issue for now without implementing the workarounds discussed above. If someone else encounters this issue, please reopen.
After I upgraded to the latest macOS 15.0 beta, the "new LaTeX display" function do not work and it gets overflow runtime error 6 at the step of "insert image".