Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am looking for a macro to delete the currently selected data in a chart from a specified .xls
I am able to write to an excel file via user input in QV, so I know this has to be possible. Trying everything I can think of in VB, but perhaps one of you is/are better than I with VB script?
thanks!
Hi, I fixed this for myself. In case anyone was wondering:
I created an inputbox with a variable of vMatchKey. User enters in the record ID to delete.
Button with vbscript macro to execute the following:
sub Excel_DeleteRow
MatchKey = (ActiveDocument.Variables("vMatchKey").GetContent.string)
Set oXL=CreateObject("Excel.Application")
f_name="C:\attend.xls"
Set oWB=oXL.Workbooks.Open(f_name)
Set oSH=oWB.Worksheets.Item(1)
oSH.Cells.Find(MatchKey, , , , 1, 2).EntireRow.Delete
oWB.Save
oWB.Close
Set oSH=nothing
Set oWB=nothing
Set oXL=nothing
END SUB
I now have an app where I can enter in data to an excel data source, and delete from. Works nicely.
Hi,
Any ideas on this?
I have a field in the excel document called ' recid ' . It is unique.
In qlikview, I am pulling all of the data from that excel document and displaying it as such.
I want to create a button that when clicked, deletes the current selection from the excel document.
Hi, I fixed this for myself. In case anyone was wondering:
I created an inputbox with a variable of vMatchKey. User enters in the record ID to delete.
Button with vbscript macro to execute the following:
sub Excel_DeleteRow
MatchKey = (ActiveDocument.Variables("vMatchKey").GetContent.string)
Set oXL=CreateObject("Excel.Application")
f_name="C:\attend.xls"
Set oWB=oXL.Workbooks.Open(f_name)
Set oSH=oWB.Worksheets.Item(1)
oSH.Cells.Find(MatchKey, , , , 1, 2).EntireRow.Delete
oWB.Save
oWB.Close
Set oSH=nothing
Set oWB=nothing
Set oXL=nothing
END SUB
I now have an app where I can enter in data to an excel data source, and delete from. Works nicely.