Exemple #1
0
        static void Main(string[] args)
        {
            try
            {
                //string origen = string.Empty;
                //string destino = string.Empty;

                //facturacionCtrl.procesaFacturacion(@"Z:\CaSC\2016\facturacionAvon\17-21_Octubre_16.xlsx", @"Z:\CaSC\2016\facturacionAvon\borra.xlsx");

                ////origen = args[0].ToString();
                ////destino = args[1].ToString();

                //LogCtrl.writeLog("--------------------------------------------------------------");
                //LogCtrl.writeLog("Inicia programa:" + DateTime.Now);
                //LogCtrl.writeLog("origen: " + origen);
                //LogCtrl.writeLog("destino: " + destino);

                //origen = origen.Replace("/", @"\");
                //destino = destino.Replace("/", @"\");

                //facturacionCtrl.procesaFacturacion(origen, destino);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.Read();
                LogCtrl.writeLog(e.Message);
            }
        }
Exemple #2
0
        public Workbook openBook(string path, bool readOnly = true)
        {
            Workbook xlWorkBook;

            try
            {
                object misValue = System.Reflection.Missing.Value;
                LogCtrl.writeLog(path);
                xlApp      = new Application();
                xlWorkBook = xlApp.Workbooks.Open(path, 0, readOnly, 5, "", "", true, XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
            }
            catch (Exception e)
            {
                LogCtrl.writeLog("openBookError: " + e.Message);
                throw;
            }
            return(xlWorkBook);
        }