Hey All . . .
I have used this code before, grabbed it from here (good stuff if you use SSRS):Chintak's Blog - Refreshable SSRS reports in Excel - Chintak Chhapia , and it has always worked swimmingly. I have another use case that requires this trick, but I am repeatedly getting a paste error on the last line. Any thoughts on how I can resolve this issue, see code below. Thanks! Travis
I have used this code before, grabbed it from here (good stuff if you use SSRS):Chintak's Blog - Refreshable SSRS reports in Excel - Chintak Chhapia , and it has always worked swimmingly. I have another use case that requires this trick, but I am repeatedly getting a paste error on the last line. Any thoughts on how I can resolve this issue, see code below. Thanks! Travis
Code:
Sub SessionData()
Worksheets("Sessions").Activate
Worksheets("Sessions").Cells.Delete
Range("A1").Select
Dim client As String
Dim domain As String
Dim begin As String
Dim finish As String
client = "STP_OP"
domain = "P333"
begin = "2015/05/18"
finish = "2015/05/22"
'Sessions Tab
Workbooks.Open Filename:="http://link&customer=" & client & "&Domain=" & domain & "&BaselineBegin=" & begin & "&BaselineEnd=" & finish & "&rs:Format=CSV"
' Select the range to copy from the csv
Range("A:N").Copy
'Selection.ClearContents
Application.DisplayAlerts = False
ActiveWorkbook.Close SaveChanges:=False
' Note:- Name of this file should be same as the file name.
Windows("macro.xlsm").Activate
'Copy csv data into this spread sheet at this Range
Worksheets("Sessions").Range("A1").Select
' ActiveSheet.Paste
ActiveSheet.Paste
End Sub