Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Run-time error '-2147352571'

Hi

I have a strange problem with Excel VBA -code. When I try to enable the
textbox in userform called 'Parameters' I sometimes get the run time error
'-2147352571'. When I look the debug the Excel tells me that the object
variable or with block variable is not set in the following statement
Parameters.TextBox1.Enabled = True.

The interesting part is that the code works sometimes and sometimes not. For
example I have noticed that the code stops to work if I haven't used the
Excel in ca. 10 minutes. In addition, it seems that the program doesn't work
if I have multiple Excel files simulatiously open.

I would appreciate all your comments because I cannot solve this problem.

Best regards
Vepa

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Run-time error '-2147352571'

Showing more code would help.
It may be that a variable is going out of scope under some circumstances.

Tim

"Vepa" wrote in message
...
Hi

I have a strange problem with Excel VBA -code. When I try to enable the
textbox in userform called 'Parameters' I sometimes get the run time error
'-2147352571'. When I look the debug the Excel tells me that the object
variable or with block variable is not set in the following statement
Parameters.TextBox1.Enabled = True.

The interesting part is that the code works sometimes and sometimes not.
For
example I have noticed that the code stops to work if I haven't used the
Excel in ca. 10 minutes. In addition, it seems that the program doesn't
work
if I have multiple Excel files simulatiously open.

I would appreciate all your comments because I cannot solve this problem.

Best regards
Vepa



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Run-time error '-2147352571'

Hi,

The problem is that the code doesn't need to be any more complex than this:

private sub Commandbutton1_click
parameters.show
Call testing_init
End sub

where testing_init, initializes the textbox1 in userform called parameters.
In this case:

Private Sub UserForm_initialize()
parameters.TextBox1.Value = Sheets("Parameters").Cells(5, 4)
End sub

You mentioned that it might be so that the variables go out of scope
sometimes and I would like to know how to avoid this to happen.

Best regards
Veli-Matti

"Tim Williams" wrote:

Showing more code would help.
It may be that a variable is going out of scope under some circumstances.

Tim

"Vepa" wrote in message
...
Hi

I have a strange problem with Excel VBA -code. When I try to enable the
textbox in userform called 'Parameters' I sometimes get the run time error
'-2147352571'. When I look the debug the Excel tells me that the object
variable or with block variable is not set in the following statement
Parameters.TextBox1.Enabled = True.

The interesting part is that the code works sometimes and sometimes not.
For
example I have noticed that the code stops to work if I haven't used the
Excel in ca. 10 minutes. In addition, it seems that the program doesn't
work
if I have multiple Excel files simulatiously open.

I would appreciate all your comments because I cannot solve this problem.

Best regards
Vepa




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Run-time error '-2147352571'

Have you tried initializing the form before showing it ?

Tim


"Vepa" wrote in message
...
Hi,

The problem is that the code doesn't need to be any more complex than
this:

private sub Commandbutton1_click
parameters.show
Call testing_init
End sub

where testing_init, initializes the textbox1 in userform called
parameters.
In this case:

Private Sub UserForm_initialize()
parameters.TextBox1.Value = Sheets("Parameters").Cells(5, 4)
End sub

You mentioned that it might be so that the variables go out of scope
sometimes and I would like to know how to avoid this to happen.

Best regards
Veli-Matti

"Tim Williams" wrote:

Showing more code would help.
It may be that a variable is going out of scope under some circumstances.

Tim

"Vepa" wrote in message
...
Hi

I have a strange problem with Excel VBA -code. When I try to enable the
textbox in userform called 'Parameters' I sometimes get the run time
error
'-2147352571'. When I look the debug the Excel tells me that the object
variable or with block variable is not set in the following statement
Parameters.TextBox1.Enabled = True.

The interesting part is that the code works sometimes and sometimes
not.
For
example I have noticed that the code stops to work if I haven't used
the
Excel in ca. 10 minutes. In addition, it seems that the program doesn't
work
if I have multiple Excel files simulatiously open.

I would appreciate all your comments because I cannot solve this
problem.

Best regards
Vepa






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Error handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
Run-Time Error -2147352571 Jani Excel Programming 0 March 28th 07 02:53 AM
run-time error'-2147352571(8002005) cfii Excel Programming 2 April 20th 05 03:06 AM
Run time Error -2147352571 when showing a form Ric Payne Excel Programming 2 October 2nd 03 04:48 AM


All times are GMT +1. The time now is 01:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"