27-05-22 11:54 AM
Dim sw, dw As Object
Dim ss, ds As Object
Dim excel, sheet, source, destination, cells, cell As Object
Dim xlPasteFormats as Integer = -4122
Try
sw = GetWorkbook(Handle, Source_Workbook)
dw = GetWorkbook(Handle, Destination_Workbook)
ss = GetWorksheet(Handle, Source_Workbook, Source_Worksheet)
ds = GetWorksheet(Handle, Destination_Workbook, Destination_Worksheet)
sw.Activate()
ss.Activate()
excel = ss.Application
sheet = excel.ActiveSheet
cell = excel.ActiveCell
If Source_Range="" Then
cells = sheet.Cells
Destination\_Range = "A1"
Else
cells = sheet.Range(Source\_Range)
End If
source = excel.Selection
source.Copy()
dw.Activate()
ds.Activate()
sheet = excel.ActiveSheet
cell = excel.ActiveCell
destination = sheet.Range(Destination_Range)
sheet.PasteSpecial(xlPasteFormats)
My.Computer.Clipboard.Clear()
Success = True
Catch e As Exception
Success = False
Message = e.Message
Finally
sw = Nothing
ss = Nothing
dw = Nothing
ds = Nothing
excel = Nothing
sheet = Nothing
source = Nothing
destination = Nothing
cells = Nothing
cell = Nothing
End Try
30-05-22 02:49 PM
01-06-22 08:58 AM