Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm creating (or trying to create) a macro that has to do the following:
1. execute a stored procedure which returns a list of qvw file names and their location.
2. open a qvw file (one at a time) - each qvw file has only one sheet.
3. select (activate) all objects contained in the sheet and copy them.
4. create a new qvw file.
5. create (add) a new sheet (for each qvw file open in the step 1) and paste the copied objects.
6. repeat step 2, but I will paste the copied objects in the same new qvw file, but in different sheets.
Basically, I'm stuck in step 3, 'cause I dont´t know how to copy and then paste the objects in a qvw file.
I hope you can help with this.
Thanks in advance.
Steve
I am trying to create a macro that will execute a stored procedure , can you tell me how you did step 1?
Thanks in Advance
Hello,
What I did was:
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
' String connection
strConn = "Provider=sqloledb;Data Source=LOCALHOST;Initial Catalog=QlikView;Integrated Security=SSPI;"
' Open the connection
conn.Open strConn
parameter1= xxxx
parameter2= yyyyy
' Execute the stored procedure
sqlQuery = "EXEC StoredProcedureName " & parameter1
rs.Open sqlQuery, conn, adOpenForwardOnly
Steve