3
I’m trying to access a website through Webbrowser and this morning, suddenly, the following error appeared
Unable to create an Activex control instance '8856f961-340a-11d0-a96b-00c04fd705a2' because the current thread is not in an STA (single-threaded Apartment).
I am not able to solve, because I had never been in contact with this type of error.
Follow a part of the code:
string sSite = "http://online.sefaz.am.gov.br/diselada/consultadi.asp";
Uri sUri = new Uri(sSite);
WebBrowser webSiscomex = new WebBrowser();
webSiscomex.AllowNavigation = true;
webSiscomex.Navigate(sSite);
webSiscomex.Width = 700;
webSiscomex.Height = 500;
webSiscomex.Visible = true;
webSiscomex.ScrollBarsEnabled = false;
webSiscomex.ScriptErrorsSuppressed = true;
webSiscomex.Show();
Does this question help you?
– mcamara
Can you explain better? I don’t understand, your question!
– Beatriz
Wow, I’m sorry rs... I forgot to put the link! Take a look at this link and see if it helps you! https://stackoverflow.com/questions/1418466/single-threaded-apartment-cannot-instantiate-activex-control
– mcamara
Ah! Ta comes! Thank you!
– Beatriz