Home > Software engineering >  Vb WPS operation, honesty, consult an experienced friend
Vb WPS operation, honesty, consult an experienced friend

Time:11-17

Recently want to develop a small program to manipulate the WPS, installation is WPS2016, reference is the WPS object library 3.0 (beta). The program with the following statement:
Dim wpsApp As Application

Private Sub Command1_Click ()
'Set wpsApp=GetObject (" WPS. Application ")
'Set wpsApp=GetObject (" C: \ Kingsoft \ WPS Office \ 10.1.0.6554 \ office6 \ wpsapi DLL ", "the WPS. Application")
The Set wpsApp=GetObject (" WPS. Application ")

WpsApp. Visible=True
WpsApp. Documents. The Open (" C: \ 1. Doc ")

End Sub

You life, prompt automation error, thank you!

CodePudding user response:

 Private Sub Command1_Click () 
Dim wpsApp as new WPS. Application

WpsApp. Visible=True
WpsApp. Documents. The Open (" C: \ 1. Doc ")

End Sub

CodePudding user response:

Pop-up error, the dim wpsApp as new WPS. The Application, say "undefined user type"

CodePudding user response:

Is the WPS version of the problem? Friends experienced, still meet you, thank you!

CodePudding user response:

refer to the second floor lidaixiang response:
pop-up error, the dim wpsApp as new WPS. The Application, saying that "user types undefined"


You've had a reference library, isn't it, open the object browser, look at what is its object class name,

CodePudding user response:

In this step I Set xlapp=CreateObject (" ET. Application "), always prompt ActiveX components can't create the object

CodePudding user response:

WPS version problem, only the government, the enterprise edition to support vba interaction, personal edition does not support,

CodePudding user response:

Individuals do not support after the 2012 edition

CodePudding user response:

Didn't establish a reference object, I have been a SolidWorks secondary development, after add references to dim a reference object
  • Related