Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to create a macro to open a qvw, reduce the data (remove all values), save and close the qvw.
I have code that will open and close the qvw.
What I need is code that will remove all values. Activedocument.reducedata doesn't work.
Also when I do activedocument.save, it prompts me for a file name. I just want it to save with no prompt.
Any suggestion?
ActiveDocument.SaveAs with the original file name as argument works for me to prevent the prompt.
If you need to remove all data you could create an array of the field names add pass those as second parameter to ActiveDocument.ReduceData. See attached example. In the example I hardcoded the array, but you should be able to create this by looping through the fields returned by ActiveDocument.GetFieldDescriptions.
ActiveDocument.SaveAs with the original file name as argument works for me to prevent the prompt.
If you need to remove all data you could create an array of the field names add pass those as second parameter to ActiveDocument.ReduceData. See attached example. In the example I hardcoded the array, but you should be able to create this by looping through the fields returned by ActiveDocument.GetFieldDescriptions.
Perhaps reducedata is not allowed:
temp=ActiveDocument.GetProperties.UserPermissions.ReduceData
if not temp then msgbox("Reduce Data is not allowed")
and/or it removed also path/filename (bug/feature). This could solved per ActiveDocument.SaveAs.
- Marcus