Graficacion Excel
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;using System.IO;
using System.Data.OleDb;
using System.Windows.Forms.DataVisualization.Charting;
namespace Proyecto_Excel
{
public partial class Form1 : Form
{System.Data.OleDb.OleDbConnection conn;
string strQuery;
public Form1()
{
InitializeComponent();
}
private voidseleccionarDirectorioToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult response = ruta.ShowDialog();
if (response == DialogResult.OK)
{
DirectoryInfo di = newDirectoryInfo(ruta.SelectedPath);
FileInfo[] ficheros = di.GetFiles("*.xls");
foreach (FileInfo f in ficheros)
{Lst_archivos.Items.Add(f);
}
seleccionarDirectorioToolStripMenuItem.Enabled = false;
abrirToolStripMenuItem.Enabled = true;
}}
private void abrirToolStripMenuItem_Click(object sender, EventArgs e)
{
cbo_hojas.Items.Clear();
int cant;Microsoft.Office.Interop.Excel.Application xlApp;
Microsoft.Office.Interop.Excel.Workbook xlLibro;
Microsoft.Office.Interop.Excel._Worksheet xlHoja;
xlApp = newMicrosoft.Office.Interop.Excel.Application();
xlLibro = xlApp.Workbooks.Open(ruta.SelectedPath +@"\"+ Convert.ToString(Lst_archivos.SelectedItem), Type.Missing, true, Type.Missing, Type.Missing,Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
cant = xlLibro.Worksheets.Count;...
Regístrate para leer el documento completo.