combinar celdas en excel
Publicado por roy (7 intervenciones) el 30/05/2005 17:28:48
hola a todos estoy pasando informacion de mi pagina web, a un archivo de excel, hasta ahorita lo que no he podido lograr es combinar celdas alguien me podria ayudar, por aqui les paso el codigo que llevo
function verexcel(){
excel = new ActiveXObject("Excel.Application");
libro = excel.Workbooks.Add();
hoja = libro.Worksheets(1);
hoja.Name = "Prueba";
hoja.Cells(2,1) = "2800.3";
hoja.Cells(3,1) = document.all.elretiro.value;
hoja.cells(4,1).NumberFormatLocal = "#,##0.00"
hoja.cells(4,1).Formula="=SUM(A2:A3)"
hoja.Cells.EntireColumn.AutoFit();
hoja.Cells(1,1) = "PRUEBA";
hoja.Range("A1:D1").Select *(con esta instruccion estoy seleccionando mi rango de celdas, pero la combinacion la quise hacer igual que en VB, pero me marca error el sig. codigo segun deberia hacer la combinacion)
hoja.Selection.HorizontalAlignment = xlGeneral
hoja.Selection.VerticalAlignment = xlBottom
hoja.Selection.WrapText = False
hoja.Selection.Orientation = 0
hoja.Selection.AddIndent = False
hoja.Selection.ShrinkToFit = False
hoja.Selection.MergeCells = True
pero me marca el sig. error "hoja.Selection es nulo o no es un objeto", entonces como tomas lo que esta seleccionado?, bueno espero me puedan ayudar
.
.
.
.
}
function verexcel(){
excel = new ActiveXObject("Excel.Application");
libro = excel.Workbooks.Add();
hoja = libro.Worksheets(1);
hoja.Name = "Prueba";
hoja.Cells(2,1) = "2800.3";
hoja.Cells(3,1) = document.all.elretiro.value;
hoja.cells(4,1).NumberFormatLocal = "#,##0.00"
hoja.cells(4,1).Formula="=SUM(A2:A3)"
hoja.Cells.EntireColumn.AutoFit();
hoja.Cells(1,1) = "PRUEBA";
hoja.Range("A1:D1").Select *(con esta instruccion estoy seleccionando mi rango de celdas, pero la combinacion la quise hacer igual que en VB, pero me marca error el sig. codigo segun deberia hacer la combinacion)
hoja.Selection.HorizontalAlignment = xlGeneral
hoja.Selection.VerticalAlignment = xlBottom
hoja.Selection.WrapText = False
hoja.Selection.Orientation = 0
hoja.Selection.AddIndent = False
hoja.Selection.ShrinkToFit = False
hoja.Selection.MergeCells = True
pero me marca el sig. error "hoja.Selection es nulo o no es un objeto", entonces como tomas lo que esta seleccionado?, bueno espero me puedan ayudar
.
.
.
.
}
Valora esta pregunta


0