PowerPoint ActiveX(COM interface) became very unstable suddenly

2 Ansichten (letzte 30 Tage)
raym
raym am 22 Jan. 2022
Beantwortet: raym am 23 Jan. 2022
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 Kommentar
raym
raym am 23 Jan. 2022
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

raym
raym am 23 Jan. 2022
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.

Weitere Antworten (0)

Kategorien

Mehr zu Use COM Objects in MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by