Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I created a report with multiple objects and different objects need different selections. I used attach and detach for this and it works, Because i have 12 objects in my reports, i tried to write a macro for this. For one object this macro is like:
Sub CH53 ' WH650 table
ActiveDocument.ClearAll True
ActiveDocument.GetSheetObject("CH53").Attach
ActiveDocument.Fields("WarehouseCode").Select "650"
ActiveDocument.GetSheetObject("CH53").Detach
End Sub
For some objects its works but not for all.
Another possible solution to my problem would be to prohibit removing detach from objects if i will reload data.
Riho
Hi Riho Michalski,
can you explain brefly i am unable understand what do you want.
Why not work with a set of targeted bookmarks? Easier to manage, IMHO.
Hi,
Sorry for my poor English skills, but I will try to explain more.
As I understand it is not possible to prevent the removing detach status, if I will reload data.
Sub CH51
ActiveDocument.GetSheetObject("CH51").Attach
ActiveDocument.ClearAll True
ActiveDocument.Fields("WarehouseCode").Select "600"
ActiveDocument.GetSheetObject("CH51").Detach
ActiveDocument.GetSheetObject("CH52").Attach
ActiveDocument.ClearAll True
ActiveDocument.Fields("WarehouseCode").Select "600"
ActiveDocument.GetSheetObject("CH52").Detach
ActiveDocument.GetSheetObject("CH53").Attach
ActiveDocument.ClearAll True
ActiveDocument.Fields("WarehouseCode").Select "650"
ActiveDocument.GetSheetObject("CH53").Detach
’etc.
End Sub
7. This macro is not working correctly
Riho