PowerPoint ActiveX(COM interface) became very unstable suddenly

2 ビュー (過去 30 日間)
raym
raym 2022 年 1 月 22 日
回答済み: raym 2022 年 1 月 23 日
Hi, I have been using ActiveX to control powerpoint (such as insert picture, text box) for a long time.
The background is that, recently my laptop Windows system (Dell OEM) and windows account shows many strange behavior such as frequently shows unregistered system, and the standard account B I have always been using was somehow changed to admin, but the original admin accout A was lost. So I create a new account C and made C the admin, then B is lowered to standard account. The net result is that the only difference is that many operation will pop up the account control dialogue with an unexpected password enter box.
The tpoic is that the Matlab-control-Powerpoint function shows many unpredcted errors at any part of powerpoint-related code such as :
...
bShape = aCurrentSlide.Shapes.AddTextbox('msoTextOrientationHorizontal',imgLeftDistance,imgTopDistance,fitWidth,50);pause(0.01);
bShape.TextFrame.TextRange.Text = chNameAss{i};pause(0.01);
bShape.TextFrame.TextRange.Font.Name = labelFont;pause(0.01);
bShape.TextFrame.TextRange.Font.Size = labelSize;pause(0.01);
...
Undefined function 'AddTextbox' for input arguments of type 'Interface.Microsoft_PowerPoint_15.0_Object_Library._Slide.Shapes'.
Error in pptSlide/transfer_to_slide (line 544)
bShape = aCurrentSlide.Shapes.AddTextbox('msoTextOrientationHorizontal',imgLeftDistance,imgTopDistance,fitWidth,50);pause(0.01);
Sometimes there is no error and it runs OK, but more frequently there are unpredicted error here or there.
The more strange thing is that after I debug where error emerges, and run the line of error code and even the rest code again(manual copy and run), it behaviors normally. ( If I click continue, error shows : Interrupt while evaluating UIControl Callback.).
How is the admin problem affect the active X? Is there a way to solve thie problem?
Thanks
  1 件のコメント
raym
raym 2022 年 1 月 23 日
If I run Matlab in admin mode, the situation is worse because the error begins early in the same line of code which is the 1st communication with ppt.
If I login the administrator acccount, however, it runs Ok and all the problems disappeared.

サインインしてコメントする。

採用された回答

raym
raym 2022 年 1 月 23 日
The problem is solved by 2 ways:
(1) always use admin account.
(2) let admin entitle the admin privileges to the account to be used.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeUse COM Objects in MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by