Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 yacine_b
		
			yacine_b
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I need to create a qlikview application wich can do the following things :
1/ load a script
2/ execute a macro when script loading is complete (document properties -> ....)
3/ drop all tables (wich are loades in the script)
I did step (1) et (2) successfully,
could you please help me do the (3) plzzz
.png) 
					
				
		
 Miguel_Angel_Ba
		
			Miguel_Angel_BaHello,
I don't think it's possible at least in version 9. You can remove all data (records) existing in the document with
ActiveDocument.RemoveAllData
but I don't think macros can delete tables (structure).
Regards.
.png) 
					
				
		
 Miguel_Angel_Ba
		
			Miguel_Angel_BaHello,
You can use the following code
FOR i = 0 TO NoOfTables() - 1 LET vTableDropped = TableName(0); DROP TABLES $(vTableDropped);NEXT
Whis will leave the document empty (no tables and no records), I'm not sure if that's what you want, though. Take care if you are using this code with section access, you will lock yourself out.
Hope this helps
 
					
				
		
 yacine_b
		
			yacine_b
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		thank you Miguel but that's not exactly what I want. I think that I should drop tables using macro, not in script. what do you think about it?
.png) 
					
				
		
 Miguel_Angel_Ba
		
			Miguel_Angel_BaHello,
I don't think it's possible at least in version 9. You can remove all data (records) existing in the document with
ActiveDocument.RemoveAllData
but I don't think macros can delete tables (structure).
Regards.
 
					
				
		
 yacine_b
		
			yacine_b
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		thank you for your answer, it helps me ^^
I used the "ActiveDocument.RemoveAllData" in the macro, but when I reload the application (by qv.exe /r), I get a save file dialog. I dont like get this dialog :s
 
					
				
		
do you still get the save dialog if you use
ActiveDocument.GetApplication.Quit
in the macro?
 
					
				
		
 yacine_b
		
			yacine_b
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I found a better solution.
you can create a macro like this:
