Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
As Qlikview exports data into .xls it allows only 256 characters per cell. Here we have data of more than 256 characters per cell. So that I created macro to copy from QV table and paste into .xlsx. It works fine with XP client and not works with Windows 7 client.
Server O/S: Windows 2008 R2
Client O/S : Windows XP SP3 - This macro is working fine
Client O/S : Windows 7 - This macro throws error saying "PasteSpecial method of worksheet class failed"
Macro Script:
'----------------------------------------------------------------------------------------
Public Sub ExportUnTruncated
set v=ActiveDocument.Fields("Report_Name")
If(v.GetSelectedValues.count >=1) then
set XLApp = CreateObject("Excel.Application")
XLApp.Visible = False
set XLDoc = XLApp.Workbooks.Add
set table = ActiveDocument.GetSheetObject("CH17")'Copy table and paste into Excel
set XLSheet = XLDoc.Worksheets(1) 'get the reference to the first sheet
XLSheet.Activate
table.CopyTableToClipboard true
XLSheet.Range("A1").PasteSpecial
XLSheet.Range("A1").Cells.CurrentRegion.Borders.ColorIndex = 0
XLSheet.Cells.WrapText = False
XLApp.Visible = True
Else
Msgbox("Please select Week to Export this Report")
End If
end sub
'----------------------------------------------------------------------------------------
Can you guys help me to solve this issue. Thanks in advance
Regards,
Yoga
I have tested the above macro with another Windows 7 client, It is working fine.
Issue now is it works fine with some windows 7 client and not works with another Windows 7 client and it throws "PasteSpecial method of worksheet class failed".
I assume that, may be missing some permission of IE.