Hi Sebbey,
To pass multiple sheet names as a "specified sheets" string, need to separate the names using carriage return, such as this:
string sh1name$, sh2name$, sh3name$;
sh1name$="[book1]"trial run 1"!";
sh2name$="[book2]"trial run 2"!";
sh3name$="[book3]"trial run 3"!";
string str$;
str$=%(sh1name$)%(CRLF)%(sh2name$)%(CRLF)%(sh3name$);
expWks type:=pdf export:=specified pages:=str$ filename:="TEST" path:="C:\My PDF Files" overwrite:=rename;
But this will create multiple files with names Test.PDF, Test1.PDF etc so the sheet name is lost?
Perhaps the following is better, where the names are stored in a stringarray and later you can access the string array and export as pdf, with the sheet name itself used as the file name, or some variation of the code below.
stringarray sa;
sa.Add("[book1]"trial run 1"!");
sa.Add("[book2]"trial run 2"!");
sa.Add("[book3]"trial run 3"!");
loop(ii,1,sa.GetSize())
{
expWks type:=PDF export:=specified pages:=sa.GetAT(ii)$ filename:=<sheet name> path:="C:\My PDF Files";
}
Easwar
OriginLab
P.S. When an X-function generates an error message, you can find the error code and error message using the information from this LabTalk Help File section:
http://originlab.com/www/helponline/Origin/en/Programming/mergedProjects/LabTalk/LabTalk/X-Function_Exception_Handling.html