acthanlanhlung
Thành viên mới

- Tham gia
- 18/12/07
- Bài viết
- 3
- Được thích
- 0
Em có file này nhờ các cao thủ xem giúp dùm em nó sai code khai báo ở chỗ nào.
1. Viết trực tiếp trên excel thì không bị lỗi
2. Viết trên VB6 rồi tạo file dll, xong mở excel ép vào thì bị lỗi.
Mong các cao thủ chỉ giúp em!
Private FExcelApp As Excel.Application
Public Property Set ExcelApp(ByRef excel_App As Excel.Application)
Set FExcelApp = excel_App
End Property
Private Sub Class_Terminate()
Set FExcelApp = Nothing
End Sub
Sub Timxoa()
Dim sh As Worksheet
Set sh = FExcelApp.ActiveWorkbook.Sheets("Sheet1")
With sh
X = .Range("A50").End(xlUp).Row
For I = 1 To X
If .Cells(I, 1) = "#" Then
.Range("A" & I).Select
FExcelApp.Selection.EntireRow.Delete
End If
Next
End With
Set sh = Nothing
End Sub
Sub CallDll()
Dim Goi As AA.Xoa
Set Goi = New AA.Xoa
Set Goi.ExcelApp = Application
Goi.Timxoa
Set Goi = Nothing
End Sub