Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default VBA freezes after opening file

I have just encountered an error where stepping through code, the following
assignment statement fails:

Set fOut = Workbooks.Open(fNameOut)

fOut is a workbook variable and fNameOut is its name - basically the
workbook opens fine, but the value of fOut is Nothing. When I try to step
into the code from this point, the program refuses to go any further. There
is no error message, and execution refuses to move past the highlighted line.

--
There are 10 types of people in the world - those who understand binary and
those who don't.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default VBA freezes after opening file

Is there anything in the fNameOut variable besides the actual path and file
name? That would be the only thing that could be causing the problem.

"Geoff" wrote:

I have just encountered an error where stepping through code, the following
assignment statement fails:

Set fOut = Workbooks.Open(fNameOut)

fOut is a workbook variable and fNameOut is its name - basically the
workbook opens fine, but the value of fOut is Nothing. When I try to step
into the code from this point, the program refuses to go any further. There
is no error message, and execution refuses to move past the highlighted line.

--
There are 10 types of people in the world - those who understand binary and
those who don't.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default VBA freezes after opening file

No - that was my first instinct also. The file opens as it should, but the
assignment doesn't work. Also, I have just discovered that the assignment in
this step works fine when I set a breakpoint just past it and hit continue,
so obviously stepping through in debug mode is the culprit...
This also happens when I attempt to step through running a macro in another
workbook, like so:

Application.Run "Summary_temp_Thpt.xls!Update"

The exact same thing happens - execution will not move any further unless I
hit continue...
--
There are 10 types of people in the world - those who understand binary and
those who don't.


"JLGWhiz" wrote:

Is there anything in the fNameOut variable besides the actual path and file
name? That would be the only thing that could be causing the problem.

"Geoff" wrote:

I have just encountered an error where stepping through code, the following
assignment statement fails:

Set fOut = Workbooks.Open(fNameOut)

fOut is a workbook variable and fNameOut is its name - basically the
workbook opens fine, but the value of fOut is Nothing. When I try to step
into the code from this point, the program refuses to go any further. There
is no error message, and execution refuses to move past the highlighted line.

--
There are 10 types of people in the world - those who understand binary and
those who don't.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default VBA freezes after opening file

Is it displaying a error dialog box or does it just exit the procedure?

"Geoff" wrote:

No - that was my first instinct also. The file opens as it should, but the
assignment doesn't work. Also, I have just discovered that the assignment in
this step works fine when I set a breakpoint just past it and hit continue,
so obviously stepping through in debug mode is the culprit...
This also happens when I attempt to step through running a macro in another
workbook, like so:

Application.Run "Summary_temp_Thpt.xls!Update"

The exact same thing happens - execution will not move any further unless I
hit continue...
--
There are 10 types of people in the world - those who understand binary and
those who don't.


"JLGWhiz" wrote:

Is there anything in the fNameOut variable besides the actual path and file
name? That would be the only thing that could be causing the problem.

"Geoff" wrote:

I have just encountered an error where stepping through code, the following
assignment statement fails:

Set fOut = Workbooks.Open(fNameOut)

fOut is a workbook variable and fNameOut is its name - basically the
workbook opens fine, but the value of fOut is Nothing. When I try to step
into the code from this point, the program refuses to go any further. There
is no error message, and execution refuses to move past the highlighted line.

--
There are 10 types of people in the world - those who understand binary and
those who don't.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default VBA freezes after opening file

It doesn't display an error dialog or exit the procedure. In fact when it's
in run mode there is no error at all (i.e. if I set a breakpoint just after
the assignment step and hit continue the fOut variable is set just fine), but
in break mode it just won't step past the assignment statement at all, and
the fOut variable is kept at Nothing. The cursor just sits at the front of
the line, which stays highlighted.

Actually I'm not sure whether it's a problem or not...because the code does
run in run mode I suppose there's no problem, but it still makes me uneasy...
--
There are 10 types of people in the world - those who understand binary and
those who don't.


"JLGWhiz" wrote:

Is it displaying a error dialog box or does it just exit the procedure?

"Geoff" wrote:

No - that was my first instinct also. The file opens as it should, but the
assignment doesn't work. Also, I have just discovered that the assignment in
this step works fine when I set a breakpoint just past it and hit continue,
so obviously stepping through in debug mode is the culprit...
This also happens when I attempt to step through running a macro in another
workbook, like so:

Application.Run "Summary_temp_Thpt.xls!Update"

The exact same thing happens - execution will not move any further unless I
hit continue...
--
There are 10 types of people in the world - those who understand binary and
those who don't.


"JLGWhiz" wrote:

Is there anything in the fNameOut variable besides the actual path and file
name? That would be the only thing that could be causing the problem.

"Geoff" wrote:

I have just encountered an error where stepping through code, the following
assignment statement fails:

Set fOut = Workbooks.Open(fNameOut)

fOut is a workbook variable and fNameOut is its name - basically the
workbook opens fine, but the value of fOut is Nothing. When I try to step
into the code from this point, the program refuses to go any further. There
is no error message, and execution refuses to move past the highlighted line.

--
There are 10 types of people in the world - those who understand binary and
those who don't.

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
Excel freezes when opening a Linked Spredsheet DVENNER Excel Discussion (Misc queries) 0 March 4th 08 02:25 PM
Computer freezes when i save excel file to floppy disk. Christy Excel Discussion (Misc queries) 5 August 8th 06 10:21 PM
strange problem: excel file does not open and background freezes i EdH Excel Discussion (Misc queries) 2 April 21st 06 02:00 AM
File Open freezes Steve Simons Excel Discussion (Misc queries) 2 July 20th 05 05:20 PM
pane freezes when file is opened andy b Excel Discussion (Misc queries) 3 July 4th 05 02:28 PM


All times are GMT +1. The time now is 04:04 PM.

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

About Us

"It's about Microsoft Excel"