Topics
-
- 0 replies
- 9.1k views
I have a C# program that opens an application object via a type library. I have managed to set up my own event handlers which fire when the application events trigger, but I would actually like to override those events, rather than just know that they have occurred. Anyone know whether this is possible (and how to do it?) Found this code which suggests it is possible, but I am looking for a tutorial or similar. The code actually looks relatively simple - appears you only need to know the GUID for the application (which I guess I can find), and the DispID - not sure where that is found?
Last reply by Legend, -
- 0 replies
- 17.4k views
can anyone tell me why this code results in a style that only has the left edge set to xlhairline & the others are set to nothing? & when I edit the style in XL, it says that the border is set to left. GrayStyle = wbWorkbook.Styles.Add("gray") GrayStyle.Interior.Pattern = Excel.XlPattern.xlPatternSolid GrayStyle.Interior.PatternColorIndex = Excel.XlColorIndex.xlColorIndexAutomatic GrayStyle.Interior.ThemeColor = Excel.XlThemeColor.xlThemeColorDark2 GrayStyle.Interior.TintAndShade = -0.0999786370433668 GrayStyle.Interior.PatternTintAndShade = 0 GrayStyle.Borders(Excel.XlBordersIndex.xlInsideVertical).LineStyle =…
Last reply by kcimos, -
-
- Leaders
- *Experts*
- 6 replies
- 5.8k views
i want this to have two columns in excel can i do that Dim writer As New System.IO.StreamWriter("test.xls") writer.Write(ComboBox1.Items(0)) writer.Write(ComboBox1.Items(1)) writer.WriteLine(a) writer.WriteLine(b) writer.Flush() writer.Close()
Last reply by Agent707, -
-
-
- Leaders
- 2 replies
- 4.3k views
Hello geniuses. I have a listbox that is populated like this: connDatabase.Open() Dim pk(0) as DataColumn Dim dt as New DataTable dim da as OleDbDataAdapter Try da = New OleDbDataAdapter("Select ArtNum from Artnumber" , connDatabase) da.Fill(dt) pk(0) = dt.Columns("ArtNum") dt.PrimaryKey = pk listbox1.DataSource = dt listbox1.DisplayMember = "ArtNum" listbox1.ValueMember = "Artnum" Catch End Try That works like a charm. But when I'm trying to get all values from this listbox to another listbox using: For Each item in listbox1.Items form2.listbox2.Items.Add(item) Next I only get "System.Data.DataRowView" in the listbox :mad: Is there a way to…
Last reply by mackao, -
-
-
- Leaders
- 1 reply
- 7.6k views
hi ive an activex made in vb6. Am new to .net and attempting to use it in vb2008. i made a reference to it and added the following code to my form_load Dim mycon As New Axpass.Axiepass TextBox1.Text = mycon.GetIE() but when the form loads it gives the error, i also tried to add it as a control and call the method but it returns "" as the result, though the same method if called from a vb program works fine.. plz help and guide me..
Last reply by snarfblam, -
-
- 0 replies
- 3.2k views
Re: reading powerpoint presentations with c# Split from http://www.xtremedotnettalk.com/showthread.php?t=92732 Did you accomplish that?? Because i am trying to do the same thing! Note from moderator: Please avoid responding to threads over a month old. Creating a link to the old thread is preferred. You might also want to check out the Posting Guidelines if you haven't already. Thanks, and enjoy the forum!
Last reply by Kryptonas, -
-
- Administrators
- 6 replies
- 5.9k views
Hi! Does anyone know anything about integrating OpenOffice in .net application? Thanks! Alex :p
Last reply by Jennia, -
-
- 0 replies
- 3.2k views
Hi all, I'm writing a small tool in c# that need to read data from a given Excel table. Each column header is assigned with a name as a Named Range. And I need to read thru these names to know which information are stored in each columns. For example in $AR$132, I have a range namely "Txn\10_1\TxnDT", RefersTo: Transaction!$AR$132:$AR$132 which refer to transaction date; In $AS$132, named "Txn\10_1\Txntype", RefersTo: Transaction!$AS$132 which refer to transaction type. And there is another named range which tells the range of all columns. eg. "Txn\10_1\headers" ReferTo $AR$132:$AY$132. I wrote the following code to loop thru the headers and read the columns …
Last reply by reggme, -
- 1 reply
- 5.2k views
I am trying to handle events of Com object (PCOMM) in .Net. My problem is that when attaching a handler to the event I get the error below. "Event invocation for COM objects requires event to be attributed with DispIdAttribute" Sample code: Private WithEvents p as New AutPSTypeLibrary.AutPS the above line will throw the above exception on the CreateMainForm procedure. if I try late binding (AddHandler p.NotifyPSEvent, AddressOf fooBar) it also throws the exception. A search of google didn't yield a solution. Any help would appreciated.
Last reply by cloudmonkey, -
- 0 replies
- 2.9k views
Advice & Help needed, we have developed an application in VB.Net 2010 and uses SQL2008R2 as the backend. It is situated in several countries and uses replication over https which all works really well and includes images in the database tables. A new requirement has arrised where the app needs to create word documents which shell out to MS Word for the user to edit. These then need to be saved back in to the database. The replication side of things was just for info and can be disregarded, it just to show that storing the files on a central folder share would not work. The only way I could think at present (which is Very Crude) is to create the worddoc in the t…
Last reply by eddy99, -
-
- Leaders
- 11 replies
- 53k views
Hi, Not sure how useful this is to anyone but I had alot of trouble finding a VB.NET Screen Resolution Change functionality, so I managed to get it working, and the code is below. Can be called by: ChangeRes(1024,768) Any comments are welcome, as are bug fixes!!!! Imports System.Runtime.InteropServices Public Module resChanger Const ENUM_CURRENT_SETTINGS As Integer = -1 Const CDS_UPDATEREGISTRY As Integer = &H1 Const CDS_TEST As Long = &H2 Const CCDEVICENAME As Integer = 32 Const CCFORMNAME As Integer = 32 Const DISP_CHANGE_SUCCESSFUL As Integer = 0 Const DISP_CHANGE_RESTART As Integer = 1 Const DISP_CHANGE_FAILED As Int…
Last reply by andrew15, -
-
-
- Leaders
- 6 replies
- 5.1k views
Hey all, I'm trying to use FindWindowEx() to get a handle to the Calculator buttons. I'm using this code to drill down through the levels, which works fine until I get to the button level: hwndFrame = FindWindowEx((IntPtr)hwnd, IntPtr.Zero, "CalcFrame", ""); hwndDialog = FindWindowEx(hwndFrame, IntPtr.Zero, "#32770", ""); hwndButton = FindWindowEx(hwndDialog, IntPtr.Zero, "Button", "2"); The top two lines populate the handles just fine, but the third does not. Anyone got a clue as to why it's returning nothing for the button handle? I'm using Window Detective to obtain the UI information and it lists "Button" as the class type, how…
Last reply by blackandwhitebg, -
-
- 0 replies
- 2.6k views
Hi there, first of all, excuse me if I have bad English but I'm not used to write in English (but google will help me, je). Well, I'm trying to call functions in the AET60.dll, which contains the API for AET60 BioCARDKey (finger print and smart card reader) with c#; actually, I have succesfully called almost every function, except for those that manipulate the finger print template: capture, match, enroll. I'm sure it's a problem of parameters types, but the problem is that I can't undestand the type of the template paramter, the dll function capture for example, expects a byte pointer (byte*) to save the template, I've tryed with ref, and unsafe code (for using poin…
Last reply by nimanga, -
- 3 replies
- 21.2k views
Hi. Let me explain the setup. I am using Visual Studio .NET to develop a sort of add-in (COM class) for Excel called SQLAddin. It basically queries a SQL server and pulls in data. Now within my Visual Studio Project, the SQLAddin references a compiled COM object built with Visual Studio 6.0 called SQLOld.dll. When I complie the project I get the following files in my \bin directory: SQLAddin.dll SQLAddin.pdb SQLAddin.tlb Interop.SQLOld.dll Within Visual Studio .NET I have set the project properties to "Register for COM Interop". The reason why I am mentioning the set up for the development for this project, is that this add-in works great on my computer. The VBA in…
Last reply by speedypcnet, -
- 0 replies
- 4.4k views
Hi, first of all, sorry for my English. The problem: I receive a lot of data from an inquiry and I need to create a Excel file using interop (c#). I write data in the Excel file using a "do while". Now I save the file at the end of the do...while statement, but it means that I used a lot of memory (I could have up to 9.000.000 of rows to write in different sheets in the same file). So I thought to save the data in the Excel file on every loop. I use the saveAs() command at the first loop and then save(), but I saw that program go very slowy with this solution. I think it is because the file is rewrite completely. There is a way to save only the new data? any o…
Last reply by mgb76an, -
- 7 replies
- 5.8k views
Hi all, I'm currently doing a project that allows the user to print doc file from asp.net mobile web application. It means that the user can print doc file while they are on the move. My project is using asp.net mobile web application. I had made the enumeration of printer to allow the user to select the printer they want their document print to. I'm using the Microsoft Word 1.0 Object Library, which I add reference from the COM, to print doc file. Here are some of my code that called the Microsoft Word to print doc file for me: Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click Dim word…
Last reply by MSHANE, -
- 15 replies
- 14.6k views
It works but seems slower than it should. ideas? public static void ExportToExcel(DataTable dt) { Excel.Application xlApp = new Excel.ApplicationClass(); Excel.Workbook xlBook; Excel.Worksheet xlSheet; xlBook = xlApp.Workbooks.Add(Missing.Value); xlSheet = (Excel.Worksheet)xlBook.Worksheets.get_Item(1); //Write headers for(int i=0; i<dt.Columns.Count; i++) { xlSheet.Cells[1,i+1] = dt.Columns[i].ColumnName.ToString(); } //Write Data for(int i=0; i<dt.Rows.Count; i++) { for(int k=0; k<dt.Columns.Count; k++) { xlSheet.Cells[2+i,k+1] = dt.Rows[i][k]; } } xlApp.Visible = true; }
Last reply by dorramide7, -
-
- Leaders
- 2 replies
- 2.5k views
Hey there, I'm using API's to get the handle to a specific button in an external app. How can I derive the screen position of this child window in order to direct a send click there? Thanks, Jib.
Last reply by Jibrohni, -
-
-
- Leaders
- 6 replies
- 8.4k views
anyone know where I can find code on making a connection to and writing/reading to/from an excel spreadsheet? Thanks -Bret
Last reply by sw22, -
-
- 0 replies
- 2.9k views
I am trying to automate a travel sheet printing application for our manufacturing process. This app will read in data from an order spreadsheet for each unit to be built, plug the data into a Word document (using FormFields), and PrintOut a copy of that travel sheet for each unit. The problem that I am running into is that some of the orders may have a few thousand units in it, and the printer would run out of paper before completing the order. Is there a way to determine when the printer is out of paper through my program so that I can alert the user instead of relying on them to constantly check the printer to see if it stopped because it was out of paper vs. finishing …
Last reply by Pyth007,
-
Who's Online 0 Members, 0 Anonymous, 13 Guests (See full list)
- There are no registered users currently online