karimsrouji
New Member
- Joined
- Jan 22, 2013
- Messages
- 2
Hello,
I am trying to generate Report using a predefined template. I select the reports i want from a listbox then run the macro. The first report generates successfully; however the second report will cause an error: "Object variable or With block variable not set " when calling a table from the bookmark. The bookmark is selected successfully but can't select the table.
wdDoc.Bookmarks("BusinessScenarioAct").Select
Set tbl = Selection.Tables(1) (Error is Here)
wdDoc.Bookmarks("BusinessScenarioRisk").Select
Set tbl1 = Selection.Tables(1) (Error is Here)
wdDoc.Bookmarks("BusinessScenarioScreen").Select
Set tbl2 = Selection.Tables(1) (Error is Here)
Thanks
I am trying to generate Report using a predefined template. I select the reports i want from a listbox then run the macro. The first report generates successfully; however the second report will cause an error: "Object variable or With block variable not set " when calling a table from the bookmark. The bookmark is selected successfully but can't select the table.
wdDoc.Bookmarks("BusinessScenarioAct").Select
Set tbl = Selection.Tables(1) (Error is Here)
wdDoc.Bookmarks("BusinessScenarioRisk").Select
Set tbl1 = Selection.Tables(1) (Error is Here)
wdDoc.Bookmarks("BusinessScenarioScreen").Select
Set tbl2 = Selection.Tables(1) (Error is Here)
Thanks