1

Topic: Transfer a macro in VB6

Children hello! Prompt transferred a macro in vb6 and that that from first line does not work, to open - opens a file and visibility and on visibility review produces an error, at measures put.

2

Re: Transfer a macro in VB6

assei;
Originally xlp has type Application, further you fray it on Workbook. Also it is finite, anything will not work. Since it already other object

Set xlp = xlp. Workbooks. Open (App. Path and "\pechat.xlsx")

3

Re: Transfer a macro in VB6

VSVLAD, it is aha clear but then educate, the same file is available for me also the same code of discovery and all works, I can send the working code, other project

4

Re: Transfer a macro in VB6

VSVLAD, I am sorry really that that does not work, prompt as it to correct?

5

Re: Transfer a macro in VB6

VSVLAD, to  and in on the second variant all code works

6

Re: Transfer a macro in VB6

assei;
Look attentively at your examples, explicitly it is visible. Object Application at you in a variable XL. And xlp it was used for the book

7

Re: Transfer a macro in VB6

---- Example 1
Public xlp As Object
Public Sub open_xl () ' function of discovery of application xl
Set>>> xlp <<<= CreateObject ("ExCel. Application")
End Sub
---- Example 2
Public xlp As Object,>>> XL As Object <<<, xlk As Object
Public Sub open_xl () ' function of discovery of application xl
Set>>> XL <<<= CreateObject ("ExCel. Application")
End Sub

8

Re: Transfer a macro in VB6

VSVLAD, huge for the help all earned thanks