Hello
I'm working on an app developed in VB6 with interaction with Excel VBA
There are two functions that Utilization properties Excel.Application
How to use Excel.Application object in both functions?
***********************************
Public Function OpenExcel()
Dim xl As Object
Set xl = CreateObject("Excel.Application")
xl.Workbooks.Open ("C:\\excelformat.xls")
xl.Visible = True
Set xl = Nothing
End Function
***********************************
***********************************
Public Function NewPag()
Dim xl As Object
Set xl = CreateObject("Excel.Application")
Line = ActiveCell.Row
Column = ActiveCell.Column
Sheets("Plan3").Select
Range("A1:I48").Select
xl.Selection.Copy
Sheets("Plan2").Select
Range("A" & Line + 3).Select
ActiveSheet.Paste
Range(Column & ":" & Line + 5).Select
Set xl = Nothing
End Function
***********************************
_________________________________________________________
|Run-time error 91 (Object variable or with block variable not set).|
_________________________________________________________
Bookmarks