Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
I have a macro that works fine on qlikview client. When opening this file from the access point on qlikview server, this macro is not working as it should. The problem: The macro is not setting the object_id correctly. Instead of using specified names, it just uses TX01,TX02 and so on.
Here is the part of the macro that sets the objectId:
set zeilentextbox = ActiveDocument.Sheets("Selektion").CreateTextObject
prop = zeilentextbox.GetProperties
prop.Layout.Frame.ObjectId = "Document\zeile_text_"&k
zeilentextbox.SetProperties prop 'Einstellungen abspeichern
Another macro that fires later has to delete specific textboxes:
 for b=lbound(objs) to ubound(objs)
 objid = objs(b).GetObjectId
 IF objid = "Document\zeile_"&a THEN
 objs(b).Close
 END IF
 next
Any ideas how to tell the qlikview server so set the objectIds correctly?
PS: Other macros working fine - so executing macros generally is working.
Many thanks!
 
					
				
		
 kji
		
			kji
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		It might just be that you are trying an invalid ID, perhaps "Server\..." would work.
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		The reference guide states that layout operations (such as creating new object) are prohibited in server macros. My experience is that some functions work, some don't. But I always avoid using them because the doc is pretty clear so I have no one to complain to when they don't work.
I think the main difference here is that on the local QV, CreateTextObject creates a Document object. On the server, it creates a User object. Rules may be different.
-Rob
 wizardo
		
			wizardo
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		hi,
a quick workaround might be to adda hiddne sheet to the model with some hidden objects (textboxes, charts, etc) with predefined IDs and instead of creating new objects on the server just use these objects.
that way you can just delete the objects proeprties and assingan them again using your macro and everyone is happy:)
ofcourse if you have alot of users and you need an object or more for each then i guess this solution is bit heavy.
mansyno
 
					
				
		
 kji
		
			kji
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		It might just be that you are trying an invalid ID, perhaps "Server\..." would work.
 
					
				
		
@Johan: Fantastic Idea.
 I changed
"Document\zeile..." to
"Server\zeile..."
and now everything works fine!
