Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32::OLE - Turn off UpdateLinks when opening file.

Status
Not open for further replies.

timtrust123

Programmer
Dec 19, 2003
19
GB
Hi
I'm using Win32::OLE to open a Excel file that has links in it to different sheets.
I would like to open the workbook without updating the links.
VBA to do it looks like this
Workbooks.Open FileName:="C:/file_name.xls", UpdateLinks :=0
i have tried the following without any success

$book = $ex->Workbooks->Open ('C:\fine_name.xls',UpdateLinks = 0 );
$book->{'UpdateLinks'} = 0;
$excel->{'UpdateLinks'} = 0;

Any suggestions most welcome !
Cheers

Tim
 
First, what do you mean by without updating the links

And second change the path C:\fine_name.xls to C:\\fine_name.xls, cause perl does not like single backslash on a path.


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
Thanks for the reply. Howver as the \ is contained within '' this does not cause Perl a problem.
When you open a XLS that contains links to other spreadsheets you get a message about updating the links containd in the spread sheet. This message current appears when I run my script.

Someone who understands WIN32::OLE Please help !
 
I think you almost had it...
try:
$book = $ex->Workbooks->Open( $file, {UpdateLinks => 0} );
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top