[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1396
  • Last Modified:

excel vba - Run-time error '3704': Operation is not allowed when the object is closed

I have a macro that works fine, and then we did a MS sql process to add one row of data that we were looking for....that originally wasnt there..

this updated row occured in the MS SQL ..the macro has not changed/nor touched..

Now when the macro is run, I get the above error when trying to run.  The error occurs only on this new row that was just added to the ms sql....
the other data pulling from ms sql is fine.  

I am thinking that when the row/data was added that they either removed the NO SET COUNTS or something occurred when that row was added...or the row is LOCKED...

I am aware that the error has to do with not closing a recordset before accessing it again, but that applies to all the data..not just one row-unless its locked.

I believe the way to resolve this issue is to have the MS SQL side addressed not the excel macro....the row has to be unlocked from the MS SQL side correct?....
0
GlobaLevel
Asked:
GlobaLevel
  • 4
  • 2
1 Solution
 
knightEknightCommented:
does the row need to be committed?

... or, are you not using the (nolock) hint in the query?
0
 
GlobaLevelAuthor Commented:
Ummmm...can you explain further... I'd have to look...
0
 
GlobaLevelAuthor Commented:
no there is not a nolock hint in the macro query...not sure how to use that...
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
GlobaLevelAuthor Commented:
As far as committing...the macro only queries data...nothing permanent here...
0
 
GlobaLevelAuthor Commented:
any takers?
0
 
knightEknightCommented:
Sorry, i was out of town yesterday and not able to get back to this one.

I have no idea if this well resolve your issue, but it is easy to try :

   select col1, col2, col3, ...
   from myTable with (nolock)
   where ...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now