.NET COM Assembly Interacting With Excel Via BackgroundWorker?
Feb 24, 2011
I am writing (and teaching myself how to write) an experimental assembly in VB.NET 3.5 that is exposed via COM and then called from some Excel VBA code to initiate an instance of a class that traps some Excel events and then perform some functions on the active workbook in Excel.To initiate the class, a reference to the Excel Application is passed from the VBA (I am using a PIA for Excel in the assembly).I needed to perform a time-consuming operation on the active workbook from my assembly so I decided to use a BackgroundWorker in a WinForm so that I can display a progress dialog for the operation whilst the operation completes in the background.
I would like to know if there are any problems with interacting with Excel via COM using a background worker in this way? Reason for asking is that the main class in the assembly holds the reference to the Excel application object, and this is then passed to the BackgroundWorker so that it can determine the active workbook and then perform some operations on it. I am only accessing the workbook itself (not other objects) through one procedure.
View 2 Replies
ADVERTISEMENT
Oct 12, 2009
I have an app, it was working but when it was copied to another machine, an error occuied.
�Could Not load file or assembly �Interop.Excel,Version 1.5.0.0Culture =neutral , publickey token=Null or one of its dependencies ,System could not find the file specified�
I do have interop.excel.dll at the same place with app.
View 5 Replies
Apr 16, 2010
I have a program that reads data from excel.
I use:Imports Microsoft.Office.Interop as well as a Reference from the "COM" tab called "Microsoft Excel 11.0 Object Library"
I built my program then copied the .exe from the inDebug folder to a location on my company's server. I then double clicked the .exe and it ran as I expected it would.My boss then tried (from another computer) and he gets this error:See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
[Code]...
View 14 Replies
Dec 14, 2009
in my button click event i ececure
If BackgroundWorker4.IsBusy Then
BackgroundWorker1.CancelAsync()
End If[code]....
after proceess completed if press the button again.i got the following error msg
This BackgroundWorker is currently busy and cannot run multiple tasks concurrently.
View 6 Replies
Apr 14, 2011
I have Visual Studio 2010 and a VB Project that had a reference to Microsoft.Interop.Excel 12.0. Well recently I changed the reference version to 14.0. That was actually a mistake and now I need to bump it back down to version 12.0. However I get this error in my project now...
Project 'MyProject' requires a reference to version '14.0.0.0' of assembly 'Microsoft.Office.Interop.Excel', but references version '12.0.0.0'
of assembly 'Microsoft.Office.Interop.Excel'.
I tried removing references and adding the com object to, but no avail.
View 1 Replies
Dec 28, 2005
When running setup to install published program, the following message occurs: System Update Required: Unable to install or run the applicaiton. The application requires that asssembly CrystalDecisions.CrystalReports.Engine Version 10.2.3600.0 be install in the Global Assembly Cache (GAC) first. This version is listed in the references of the program and in my mind, be included in build. How do I get by this error?
View 23 Replies
Apr 18, 2012
When running setup to install published program, the following message occurs: System Update Required: Unable to install or run the applicaiton. The application requires that asssembly CrystalDecisions.CrystalReports.Engine Version 10.2.3600.0 be install in the Global Assembly Cache (GAC) first. This version is listed in the references of the program and in my mind, be included in build. How do I get by this error?
View 2 Replies
Dec 4, 2009
I have recently upgraded an VB6 project to vs2008. I was almost finished when the following error occured. Unable to emit assembly: Referenced assembly AxInterop.MSFlexGridLib does not have a strong name Prior to this error appering, I tested my app several times and it was fine. Only after publishing it did the error appear. I have tried all solutions I could find, but nothing helps. I have read [URL]
View 1 Replies
Jun 17, 2009
I receive this error as "Assembly Load Error" whenever adding a form or other object that has to be inherited.
"Unable to load assembly. Ensure that the file is a valid .net Framwork assembly"
View 1 Replies
Apr 2, 2012
I am loading an Assembly using Assembly.LoadFrom() as the assemblies are located in a different path from Application Base directory.
Dim oAssembly As Assembly = _
Assembly.LoadFrom("C:\MyFolder\" + ddlXlate.SelectedItem.ToString() + ".dll")
And I consume a Type from that assembly without any problem:
oXML = CType(oAssembly.CreateInstance(sBaseType + ".XlateContainer"), _
XlateBase.XlateContainer)
However, the problem occurs when I try to use a Type from this assembly from within another method like the one below:
oComboBox.DataSource = _
[Enum].GetValues(Type.GetType(sType + "+ItemEnum," + sAssemblyName))
sAssemblyName is the one I loaded using LoadFrom() actually. After it said it cannot find the assembly, I used AssemblyResolve event which solved my problem :Subscribing AssemblyResolve event :
AddHandler AppDomain.CurrentDomain.AssemblyResolve, _
AddressOf MyResolveEventHandler
Event Handler Method:
Private Shared Function MyResolveEventHandler(ByVal sender As Object, _
ByVal args As ResolveEventArgs) As Assembly
Return Assembly.LoadFrom("C:\PSIOBJ\" + args.Name + ".dll")
End Function
And I thought maybe the error occurs because it cannot find a dependent assembly defined in assembly manifest file I loaded using LoadFrom() already but when I checked the args.Name, I saw it was trying to load same assembly and after that it worked without any problem. So basically a type in the loaded assembly cannot be found before the event adding change.
My old code was using AppDomain.CurrentDomain.Load() and Assembly.Load() methods and they were working fine without the AssemblyResolve event. I was able to reach types in dynamically loaded Assembly from every where within the same AppDomain.
LoadFrom() can find dependencies automatically within the same requested assembly path and that couldn't be problem as everything this dll needs was there. So at first it looked like a AppDomain problem to me as it looks like it seems it can reach assemblies from Load context instead of LoadFrom context and I am now using LoadFrom context.But now it seems I should pass oAssembly instance evertwhere to use any type from the loaded assembly?Doesn't it load the assembly where I can reach it everywhere (same AppDomain) using simple Type.GetType(...) method?
View 2 Replies
Jun 1, 2011
I'm wanting to include a system tray icon in my WPF project, and found this resource:[URL]..which looks like it will work beautifully, but it's written for C# and I'm using VB.net for this project. I downloaded his project and built the notifyicon as a DLL, then added as a reference to my project.
It throws up an error: Unable to emit assembly: Referenced assembly 'Hardcodet.Wpf.TaskbarNotification' does not have a strong name So I'm trying to figure out the best way to proceed. Do I need to strong name it, or is there a better way to do this?
View 2 Replies
Oct 9, 2008
I've got an exception when I deployed my application: "the located assembly's manifest does not match the assembly reference" What I remember is changing the project name from the previous source code, does it affect that much?
View 1 Replies
Jun 25, 2012
I have created several DLL (.NET) libraries that are used in several projects. In these DLL libraries I want to know/retrieve which assembly (EXE) calls/uses the library, so if possible I want to know info like assembly name (EXE), strong name, version number, etc.
NB: Examples may be in C# or VB. I use both languages.
View 2 Replies
Apr 7, 2009
I have written a .net assembly which plugs into to a third party COM application. The .net assembly is COM visible to the third party application. However this .net assembly references other regular assemblies. If I put these assemblies in the GAC the COM visibile assembly sees them without a problem. However for various reasons I do not want to put them into the GAC but I cannot get my COM visible assembly to see the other assemblies when they are in other locations. I have tried putting them in the same directory as the COM visible assembly. I have tried putting them in the same directory as the third party app's exe but neither of these work.
View 5 Replies
Jul 10, 2010
I searched around the web for some tutorials and code examples, but couldn't find anything up to date. For example if i wanted to hit the "+" button on the windows calculator using an application i made what would be the best route to do so?
View 3 Replies
Apr 15, 2012
I am lookin for source from where i can learn to change control properties at runtime using VB.NET. Actually I havent started working on the project so I cant mention exactly what I need.
View 4 Replies
Mar 17, 2009
I have a project in Visual Basic 2008 where there is a Main Class and couple of classes inside the Main Class. I want to be able to share variables/objects within the Main Class and SubClasses while those vars/object are instanced.
Ex:
Code:
Public Class clsMain
Public t as New clsSub1
[Code].....
So, can i make var1 be in separate instances per clsMain in the memory while being able to access the var1 in clsSub1?
View 2 Replies
Nov 16, 2010
I am trying to have a ComboBox on my form, be able to change the selected item in a Listbox/Combobox on a website, through a webbrowser control.
For instance, here is the HTML coding I am trying to interact with on the webpage:
<select name="day">
<option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option>
[Code].....
View 3 Replies
Mar 12, 2009
I want to be able to make Internet Explorer navigate to the "about:blank" page every time its user navigates to a wesite that is blocked by the HOSTS file. Does anyone know the code that I can use to do this?
View 18 Replies
Oct 10, 2009
What classes has vb.net got to work with video files...like mpg or mp4i wanna write some code to be able to save a specific video frame to a jpg image.
View 1 Replies
May 11, 2012
I have a MDI parent on which i launch a child form
Dim NewMDIChild As New Frm_addOT
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
His child form contains several comboboxes which hold data from a dbase(sql)
When new data is entered in the cmb it checks the database and if it isn't in there it launches another window
FRM_OTlistaddklant.Visible = True
and copy's the newly entered text in a textbox.
FRM_OTlistaddklant.TB_klantnaam.Text = OTaddklant_naam
then i can give in the details etc.
now, when this is done and the users presses a button "Add"
the information is written to sql(which works perfect)
than i have a public sub on the Frm_addOT which should refill the combobox and
also set the backcolor to a specific color.
and the last two things will not work. Actually when i try to change the backcolor on Frm_addot it triggers the event backcolorchanged and says it has changed but it is not visible.
View 5 Replies
Oct 1, 2011
I'm trying to start to use the Task class for multi-threading. This is a really simple example so I can work out the ins and outs. As an example, I have the below thread, the thread.sleep is used to represent large amounts of data processing, at the end of which I'd like to update something on the screen. Please advise a good way to achieve the idea of the below code with respect to the text box update.
With the old threading system, I would grab the UI context, and do a .post/.send to it. I'd like to have that ability with the newer task system, but am open to the preferred way of solving this.
As a back ground, the threads I will be replacing were previously constantly running during the app with a do/while that was killed at app close.
[Code]...
View 6 Replies
Apr 3, 2011
I want to make a usercontrol that I can then use on my project form, and then interact with it. (for example, get the result of a calculation that was made in the user control and then make futher calculations on my form) I basicly know how to make a Usercontrol, by not how to use the information that it derives for further use.
View 3 Replies
Jul 2, 2009
I just wondered if it was possable to say load a webpage then press a button on a certan webpage?
View 9 Replies
Apr 26, 2012
I am using VB.NET to automate a web form submission using SHDocVw.InternetExplorer. I have navigated to the form, filled in all of the fields successfully, and clicked the update button. By design the web application then opens a JavaScript SubModal window in the center of the screen. It looks like a "floating iframe" for lack of a better description. [code]I need to find a reliable way (i.e Not SendKeys). to get the HTML source of this popup in order to click a button.
View 1 Replies
Feb 27, 2011
following error as I am unable to find a fix:Description:A problem caused this program to stop interacting with Windows.
[Code]...
View 3 Replies
Jan 9, 2010
I didn't know where to post this question so I hope I put it in the right forum...I am not new to Visual Basic, however I am definitely not an advanced user. I would like to build an application that would allow me to interact with other programs on my computer. For example, if I were to build an application that could control iTunes, how would I go about this?
Or, I am looking to make an application that would allow me to do little things on my computer like disable my track pad if I have a mouse plugged in. How would I build something that could interact with windows (or iTunes) like that?
View 2 Replies
Jul 23, 2009
I have a windows form that I would like to have search for an html button in the user's browser. I would need the location of the button on the screen.
View 4 Replies
Jul 19, 2010
I have a windows form that I would like to have search for an html button in the user's browser. I would need the location of the button on the screen
View 13 Replies
Nov 15, 2009
I have a method that is asynchronously called when System.Net.Sockets.NetworkStream.BeginRead completes.
skDelegate = New AsyncCallback(AddressOf skDataReceived)
skStream.BeginRead(skBuffer, 0, 100000, skDelegate, New Object)
In that callback method, I need to interact with the UI thread.
Sub skDataReceived(ByVal result As IAsyncResult)
CType(My.Application.OpenForms.Item("frmMain"), frmMain).refreshStats(d1, d2)
End Sub
This causes an exception after the method completes. (when End Sub is executed)
[Code]...
View 4 Replies