Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VPageBreak Problem
Hi,
I am automating Excel from MFC (Is this the right forum?) and using something like the following code: .. .. CVPageBreaks oVPBs = oSheet.get_VPageBreaks(); int npb = oVPBs.get_Count(); for (i = 0; i < npb; i++) { CVPageBreak oVPB = oVPBs.get_Item(i + 1); oRange = oVPB.get_Location(); int cc = oRange.get_Column(); .. .. } .. .. // show Excel to the user theApp.m_oExcel.put_Visible(TRUE); This works when npb is 2 but for an example where npb is 5 I get an exception on the get_Item when i = 1 i.e. the second page break. The error code is 8002000b or invalid index. If I move the put_Visible up so all this happens with Excel on the screen it works again. The same thing happens with Excel 2000 on Win2k and with Excel 2003 on XP. Any Ideas? Thanks, Bill |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
Hmmm... Excel OVERRIDES vpagebreak and hpagebreak vb code???? | Excel Programming | |||
Hmmm... Excel OVERRIDES vpagebreak and hpagebreak vb code???? | Excel Programming | |||
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? | Excel Programming |