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 CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by