Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-09-2017, 01:52 PM
CLoos CLoos is offline set row object variable error Windows 7 64bit set row object variable error Office 2010 64bit
Novice
set row object variable error
 
Join Date: Mar 2017
Posts: 4
CLoos is on a distinguished road
Unhappy set row object variable error

I have been struggling with this for days and I have tried multiple ways of getting this task done but it's always buggy. Either I get an object error with the pastespecial method or I get the object variable error with value = value, referring to the row1. If I set row1 to a range, I get the to the open.workbooks and the code stops due to a built in function. I do not know enough to fix this and I would sure appreciate some help and understanding. I just want to copy a value from an open workbook then open a closed workbook, find the value, and add an "A" six cells to the right, then close the workbook. Here's the mess I have. Please ignore the variables with "2's" I am going to delete them.

Sub Update_Log_Status2()
Dim wrkbk1 As Workbook
Dim sht1 As Worksheet
Dim row1 As Range

'Path to closed file
Const filePath1 As String = "J:\Manual PO's\Manual PO Log\Manual PO Log.xlsx"


'Stop updating the screen
Application.ScreenUpdating = False
'
'Open the workbook
Set wrkbk1 = Workbooks.Open(filePath1)

'Grab the first sheet in wrkbk
Set sht1 = wrkbk1.Sheets(1)
Set row1 = ActiveSheet.Rows



'Find value in B21 of active worksheet in colum D of closed workbook
row1 = sht1.Range("D").Find(Range("B21").Value, , xlValues, xlWhole).row
sht1.Cells(row1, 10).Value = "A"

'Close workbook & save
wrkbk1.Close True

'Set the screen to update
Application.ScreenUpdating = True

End Sub
Reply With Quote
 

Tags
closed workbook, excel vba, object variable error



Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Variable or With block variable not set Raza Excel Programming 8 01-15-2015 12:19 AM
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge Berryblue Mail Merge 1 11-13-2014 05:36 PM
set row object variable error Run-time error 91 object variable or with block variable not set JUST ME Word VBA 4 03-25-2014 06:56 AM
set row object variable error Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM
XML parsing & Object variable not set (Error 91) tinfanide Excel Programming 0 12-29-2011 08:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft