Source.PasteSpecial not working in excel 2010 0
-
macro code not working (0) 0%
-
Source.pastespacial (0) 0%
Dear all,
Below code works in excel 2003 but not working in excel 2010. Can anyone help me?when I run the macro it gives an error "Run-time error'1004':, pasteSpecial method of Range class failed"
Code goes like this
Code
Private Sub CommandButton1_Click()
ChangeText Range("C3:J32")
WriteRangeToTextFile Range("D3:J32"), "C:\HTS_Quality\TMS_Dashboard_HTSQ_spreadsheet.txt"
End Sub
Function ChangeText(Source As Range)
Source.Copy
Run Shell("C:\WINDOWS\NOTEPAD.EXE", 1)
SendKeys "^v", True
SendKeys "^a", True
SendKeys "^c", True
SendKeys "%fx", True
Wait
SendKeys "%N", True
Source.NumberFormat = "@"
Source.PasteSpecial
End Function
Display More