Sharepoint and updating of excel lists

  • Thread starter Thread starter Dave
  • Start date Start date
Dave wrote...
Anyone might have any clues on this in this group:
....

Did you try using

use Win32::OLE::Const 'Microsoft Excel';

? If so, what did the statement

printf "xlListConflictDialog = %d\n", xlListConflictDialog;

display? If this throws off an error, this constant may be given
in Sharepoint's TypeLib, in which case you'd need to pull them
in as well. Alternatively, in VBE's immediate window run

? xlListConflictDialog

and use the number it returns in your perl statement.
 
yes i "use Win32::OLE::Const 'Microsoft Excel'"
printf "xlListConflictDialog = %d\n", xlListConflictDialog;

this gives me back a number from 0-3 depending on what i choose from,
in my case it would be a 1.

* xlListConflictDiscardAllConfli­cts indicates to accept the version
of
the data stored on the SharePoint list
* xlListConflictError indicates to raise an error if a conflict occurs
* xlListConflictRetryAllConflict­s indicates to overwrite the version
of
the data stored on the SharePoint list

how would i use the number in a statement? i admit i am not good at
win32::OLE either :-)

The excel file have allready been created with a list option, all i do
is enter the values in the lists. And then in the end i want to sync
it.

test code:

use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3; # die on errors...

my $xls = "C:\\excel.xls";
my $Excel = Win32::OLE->GetActiveObject('Excel.Application') ||
Win32::OLE->new('Excel.Application', 'Quit');
$Excel->Workbooks->Open( "$xls" );
$Excel->ActiveWorkbook->Worksheets('Sheet1')->Cells(2,2)->{Value} =
"value";

##here i need to synchronize it with the sharepoint server
## $Excel->ActiveWorkbook->xlListConflictRetryAllConflicts;
$Excel->ActiveWorkbook->Save();
$Excel->ActiveWorkbook->Close();
$Excel->Quit();
 
Back
Top