| |||
Respuesta: abrir excel desde visual
Código:
Reemplaza "C:\Program Files\Microsoft Office\Office12\excelcnv.exe" por la ruta del Excel. Ese es del Excel 2007 en Windows XP en Ingles Call Shell("C:\Program Files\Microsoft Office\Office12\excelcnv.exe", vbNormalFocus) |
| |||
Respuesta: abrir excel desde visual claro pero necesito crear el objeto,lo que me pasaste ya lo hice - Dim xlApp As Microsoft.Office.Interop.Excel.Application aca es donde me da el error |
| |||
Respuesta: abrir excel desde visual Te paso un codigo que hace un poco de todo Espero te sirva Private Sub Command1_Click() Dim ArchSalida As String Dim objExcel As Object Set objExcel = CreateObject("Excel.Sheet") ArchSalida = "C:\pp" 'Hago que Excel no sea visible objExcel.Application.Visible = False 'Pongo Datos objExcel.Application.Cells(1, 1).Value = "aaaa" objExcel.Application.Cells(1, 2).Value = "bbbb" objExcel.Application.Cells(1, 3).Value = "cccck" 'Le doy formato a algunas objExcel.Application.Cells(1, 3).Font.Color = vbBlue objExcel.Application.Cells(1, 3).Font.Underline = True 'Le agrego un hipervinculo objExcel.ActiveSheet.Hyperlinks.Add Address:="C:\pp.bmp" ' Guardo el archivo objExcel.SaveAs ArchSalida & ".xls" ' Cierro el Excel objExcel.Application.Quit ' Libero Set objExcel = Nothing End Sub |