excel - Method Range of Object Global failed when using named range -


I am trying to create a VBA script, which runs a selected script in SQL and pastes it in the named category is. Below is my code; ADODB.Connection Dim rcrds like ADODB.Recordset sub runQuery (string as strsQL, as rngResults range) option rcrds = new ADODB.Recordset rcrds.Open StrSQL, cnt, adOpenDynamic, AdLockOptimistic, adCmdText rngResults.ClearContents rngResults.CopyFromRecordset rcrds ending deputy folk sub update_Scorecard_2 () dim as stroked string as myrange range application. ScreenAppting = Incorrect set cnt = new ADODB.Connection cnt.Open "Provider = MSDAORA; Data Source = ODSPRD01; user id = DWH_ADH; password = mypassword; "call runQuery (range (" DATA_DUMP_SQL "). Value, range (" DATA_DUMP ") cnt. Close end Sub

I have the error "the method range of the object global is failing". I think it is an issue with Vba, to know if it does not appear in the sheet , But I understand that it should not be an issue with the named category?

call runQuery (range ("DATA_DUMP_SQL"), to call,). Value, range ("DATA_DUMP" ))

What's wrong with my code?


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -