Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
Hmmm... Excel OVERRIDES vpagebreak and hpagebreak vb code???? wjoc1[_2_] Excel Programming 1 October 14th 04 12:58 PM
Hmmm... Excel OVERRIDES vpagebreak and hpagebreak vb code???? wjoc1 Excel Programming 1 October 14th 04 03:33 AM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM


All times are GMT +1. The time now is 10:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"