I have a macro which is running from Excel. This macro opens PowerPoint slides, performs some work, and then closes them. The problem I am having is the following:
这一错误信息似乎在整个宏观运行期间随机出现。 这一错误不能与
造成这一错误的具体法典如下:
myPresentation.Close
我测试的情况:
myPresentation.saved=true
myPresentation.Close
哪一问题没有解决
myPresentation.saved=true
myPresentation.windows(1).activate
myPresentation.Close
也没有工作。 最后,我提出的最稳定的解决办法如下:
This function is implemented as a fix for an issue where VBA reports "Presentation.Close: Failed"
@param pres as Object<PowerPoint.Presentation> - The presentation to close.
@docs https://stackoverflow.com/questions/78156015/vba-powerpoint-run-time-error-2147467259-80004005-presentation-close-fail/78156016#78156016
Public Sub ClosePresentation(ByVal pres As Object)
pres.windows(1).Activate
While Not pres.Saved
pres.Saved = True
Wend
stdWindow.CreateFromApplication(pres.Application).Quit
End Sub
该图书馆使用stdWindow,这是一个开放源图书馆。 归根结底,这意味着间接向窗口发出的近距离信息(通过Windows AP)似乎更为稳定,因为我认为,这正是用户通常如何关闭窗口。
必须指出,所挽救的环境似乎具有某些种族条件,因此也存在漏洞。
For an Excel formula I need the first cell out of a list of cells which contains a numeric value: A | B | C | ... | Z | ----------------------------- | 0.1 | 0.4 | ... | =0.1 | | ...
I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...
The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...
I m using Application run to call several macros in order like this. Sub Run_All_Macros() Application.Run ("Macro_1") Application.Run ("Macro_1") End Sub When I start Run_All_Macros, all the ...
Does anyone know how to convert an Excel date to a correct Unix timestamp?
I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...
I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...
I have created an Add-In in C# that implements user defined functions for Excel. These UDF s return immediately, but they control background asynchronous procedures. These procedures have status ...