Created
July 12, 2013 19:19
-
-
Save 1dolinski/5987008 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <---------- [ Program Overview ] ----------> | |
// Take BND all BND pages from FIS and put them into excel | |
using System; | |
// fundamental classes and base classes for value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions | |
using Microsoft.Office.Interop.Excel; | |
// using the Excel namespace (added in Microsoft Excel 11.0 Object ) | |
using System.Reflection; | |
namespace ConsoleApplication3 | |
{ | |
public class ExcelManagemenet | |
{ | |
public static void NewExcelApp() | |
{ | |
Application xl = null; | |
_Workbook wb = null; | |
// Option 1 | |
xl = new Application(); | |
xl.Visible = true; | |
wb = (_Workbook)(xl.Workbooks.Add(XlWBATemplate.xlWBATWorksheet)); | |
} | |
} | |
public class WindowManagement | |
{ | |
[DllImport("coredll.dll")] | |
static extern bool SetForegroundWindow(IntPtr hWnd); | |
private void BringToFront(Process pTemp) | |
{ | |
SetForegroundWindow(pTemp.MainWindowHandle); | |
} | |
} | |
public class Program | |
{ | |
static void Main(string[] args) | |
{ | |
System.Console.WriteLine("Put FIS to the Main Menu"); | |
System.Console.Read(); | |
// need to reference this excel sheet | |
ExcelManagemenet.NewExcelApp(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error 1 The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?) E:\project\csharp\ConsoleApplication3\ConsoleApplication3\Program.cs 33 10