The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Automation Server/COM and LabVIEW
 How can I iterate the WorksheetPages?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yanfeng39 Posted - 09/08/2013 : 05:37:37 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.5
Operating System: win7 x64
Hi,
I'm using Origin automation Server in C++ (VS2010). I encountered a problem that when I'm trying to access the count of worksheetPages it doesn't work fine. How can I iterate the WorksheetPages?

Here is the code:

WorksheetPagesPtr WksPagesPtr;
WorksheetPagePtr WksPagePtr;

WksPagesPtr=m_pClient->operator ->()->GetWorksheetPages();
for (long idx=0;idx<WksPagesPtr->Count;idx++)//error!
{
WksPagePtr=WksPagesPtr->Item[idx];
...
}
2   L A T E S T    R E P L I E S    (Newest First)
robertodumas Posted - 03/16/2016 : 11:54:08 PM
yes..taht script works like magic..! Thxs Penn..I used to have the same problem....just copy & paste the script and the problem is gonna take away





http://cancelesusdeudas.blogspot.mx/
Penn Posted - 11/18/2013 : 02:11:57 AM
Hi,

I have tried the following code, and it works.

CoInitialize(NULL);
{
	OriginApp::IOApplicationPtr pOrigin = NULL;
	pOrigin.CreateInstance(__uuidof(ApplicationSI));
	pOrigin->Visible = OriginApp::MAINWND_VISIBLE::MAINWND_SHOW;

	OriginApp::WorksheetPagesPtr wksPagesPtr;
	OriginApp::WorksheetPagePtr wksPagePtr;
	wksPagesPtr = pOrigin->WorksheetPages;
	int nCount = wksPagesPtr->Count;

	for(long i = 0; i < wksPagesPtr->GetCount(); i++)
	{
		wksPagePtr = wksPagesPtr->GetItem(i);
		cout << wksPagePtr->GetName();
	}
}
CoUninitialize();


Penn

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000