Hi thank you for helping me
but I got confuse these is the part of the code
is ok where I put the $Hoja->Activate();
#!/usr/perl/bin
use Win32::OLE;
use Win32::OLE::Variant;
use Win32::OLE::Const 'Microsoft Excel';
my $filename = $ARGV[0];
my $filename2 = $ARGV[1];
#################################################################
# Nota :
# para el programa semarnat este es el formato:
# SEMARNAT NUMEROFOLIO.XLS FORMATONUMEROFOLIO.XLS
#
# para el programa que genera el codigo de barras pdf417:
# Pdf417lib NUMEROFOLIO.ASC FORMATONUMEROFOLIO.JPG
#
#################################################################
system ("copy datafill.xls $filename2.xls");
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Quit');
#------ Abro el archivo CSV y lo dirijo al primera hoja de trabajo
+ -----
my $Book = $Excel->Workbooks->Open("C:\\projectword\\$filename.xls
+");
my $Sheet = $Book->Worksheets(1);
#----- View file -----------------------
my $excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Q
+uit');
#Generacion del codigo para agregar
my $Libro = $excel->Workbooks->Open("c:\\Projectword\\$filename2.x
+ls");
my $Hoja = $Libro->Worksheets(1);
# $Hoja = $workbook->>Worksheets(1);
#my $UltimaRegla = $Hoja->UsedRange->Find({What=>"*",
# SearchDirection=>xlPrevious,
# SearchOrder=>xlByRows})->{Row};
#
#my $Renglon = $UltimaRegla + 25;
$Sheet->Range("A1")->Copy();
$Sheet->Paste ({Destination => $Hoja->Range("H9")});
$Hoja -> Range("H9") -> Font -> {Size}=7;
$Sheet->Range("B1")->Copy();
$Hoja -> Range("B61") -> Borders(xlEdgeLeft) -> {LineStyle} =
+ xlContinuous;
$Hoja -> Range("B61") -> Borders(xlEdgeLeft) -> {Weight} =
+ xlThin;
$Hoja -> Range("B61") -> Borders(xlEdgeBottom) -> {LineStyle}
+ = xlContinuous;
$Hoja -> Range("B61") -> Borders(xlEdgeBottom) -> {Weight}
+ = xlThin;
######################################################################
+############################
system ("java -classpath . Pdf417lib $filename.asc $filename2.jpg 0.3"
+);
$Hoja->Activate();
$Hoja -> Range("E47")->Select();
$Excel->ActiveSheet->Pictures->Insert('c:\projectword\$filename2.jpg')
+;
$excel -> {DisplayAlerts} = 0;
$excel->{Visible}= 1;
# $Hoja->PrintOut();
# $Hoja->PrintOut();
$excel->close();
I try it like this put the barcode is still being place on top I am doing something wrong??? |