Excel Macro Run Time Error 91
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss runtime error 91 in excel the workings and policies of this site About Us Learn more
Excel Visual Basic Runtime Error 91
about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack
Excel Macro Run Time Error 1004 Application Defined Or Object Defined
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
Excel Macro Run Time Error 9 Subscript Out Of Range
each other. Join them; it only takes a minute: Sign up VBA Run time error 91. Trouble setting object variable up vote 0 down vote favorite I don't think the answer is too complicated, I must just be missing something basic. To give context, the code and this macro were written by an employee who was no longer run time error 438 excel macro working here when I started. I have just used it a number of times on a monthly basis and it suddenly gave me an error today when I attempted to run the VBA script. It gives me the standard Run Time Error 91 (Object variable or block variable not set). The code specifically is: Dim DataBook As Workbook Set DataBook = Workbooks.Open(Import_File_Path) DataBook.Worksheets("Sheet1").Name = "Database" Application.DisplayAlerts = False Tool.Worksheets("Database").Delete <-----highlighted error line Application.DisplayAlerts = True DataBook.Worksheets("Database").Move before:=Tool.Worksheets(1) The VBA script is attempting to take raw data from an Excel sheet that I have already generated, and import the file (thus that part in the Set line) and perform a number of calculations to create more data and stats from there. However the problem I feel lies in the section I posted here and the objects and variables. The highlighted error row is the one that says Tool.Worksheets("Database").Delete. When I added a Watch to that row the value states Object Variable or With block variable not set. This leads me to believ
be down. Please try the request again. Your cache administrator is webmaster. Generated Sat, 15 Oct 2016 09:32:15 GMT by s_ac15 (squid/3.5.20)
Tech Support Guy, we highly recommend that you visit our Guide for New Members. Solved: Run Time https://forums.techguy.org/threads/solved-run-time-error-91-object-variable-or-with-block-variable-not-set.829238/ Error 91 - Object variable or With block variable not set Discussion in 'Business Applications' started by mamdani99, May 22, 2009. Thread Status: Not open for further replies. Advertisement http://abhayappssolution.blogspot.com/2013/05/web-adi-excel-run-time-error-91-error.html mamdani99 Thread Starter Joined: Oct 21, 2008 Messages: 15 Hi All, Excel VBA Error : Run Time Error 91 - Object variable or With block variable not set time error I have a userform with some textboxes and Command Buttons. When I add the record, I receive an error message. The Code I wrote on Command Button to save the data into worksheet is as follow: Code: Private Sub cmdAddScore_Click() Dim LastRow As Object Dim LastRow1 As Object Dim ws As Worksheet Dim ws1 As Worksheet Dim RESPONSE run time error As Double Set ws = Worksheets("Matches") Set ws1 = Worksheets("Schedule") Set LastRow = ws.Range("A65536").End(xlUp) Set LastRow1 = ws1.Range("H65536").End(xlUp) RESPONSE = MsgBox("Do you want to save this record?", vbYesNoCancel) If RESPONSE = vbYes Then LastRow.Offset(1, 0).Value = txtMatchNumber.Text 'Column A LastRow.Offset(1, 1).Value = Format(txtMatchDate.Text, "dd.mmm.yy") 'Column B LastRow.Offset(1, 2).Value = Format(txtMaxOvers.Value, "00.0") 'Column C If optBattingFirst.Value = True And txtTeam1Name.Top = 150 Then LastRow.Offset(1, 3).Value = "BF" 'Column D ElseIf optBattingFirst.Value = False And txtTeam1Name.Top = 180 Then LastRow.Offset(1, 9).Value = "BS" 'Column J End If If txtTeam1Runs.Top = 150 Then LastRow.Offset(1, 4).Value = txtTeam1Name.Text 'Column E LastRow.Offset(1, 5).Value = txtTeam1Runs.Value 'Column F LastRow.Offset(1, 6).Value = txtTeam1Wkts.Value 'Column G LastRow.Offset(1, 7).Value = Format(txtTeam1Overs.Value, "00.0") 'Column H LastRow.Offset(1, 8).Value = txtSOTeam1.Text 'Column I Else LastRow.Offset(1, 10).Value = txtTeam1Name.Text 'Column K LastRow.Offset(1, 11).Value = txtTeam1Runs.Value 'Column L LastRow.Offset(1, 12).Value = txtTeam1Wkts.Value 'Column M LastRow.Offset(1, 13).Value = Format(txtTeam1Overs.Value, "00.0") 'Column N LastRow.Offset(1, 14).Value = txtSOTeam1.Text 'Column O LastRow1.Offset(1, 0).Value = "Yes" 'new line End If If optBattingSecond.Value = True And txtTeam2Name.Top = 150 Then LastRow.Offset(1, 3)
your Excel setting with the screenshots attached below and change accordingly. 1> Open MS Excel File > Options > "Trust Center" > "Trust Center Settings..."A> "Trusted Location" >> "Add new location..." >> Add a location where you save your Web ADI Templates >> EX: C:\ADI Templates B> "Trusted Document" C> "Add-ins" D> "ActiveX Settings" E> "Macro Setting" F> "Protected View" G> "File Block Setting" Close all the open Excel sessions and try again, it should work. 2> If this won't resolve the problem, check your Web Browser 'Setting' Options and add your Oracle Application URL as a Trusted/Secured Site. Posted by Abhay Kumar at 9:36 AM Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: Web ADI 14 comments: AnonymousSeptember 5, 2013 at 3:31 AMThis is really awesome, I tried this and it resolved the issue. Thanks for this valuable information.ReplyDeleteAnonymousOctober 17, 2013 at 1:05 PMVery helpful. Solved the entire set of latest problems I was having!ReplyDeletejack MethueApril 22, 2014 at 2:55 AMThanks for this informative web page which helps me to fix runtime error 91. I am very happy because now I am free from this problem so again thanks.ReplyDeleteaalia lyonApril 28, 2014 at 11:51 PMThat's nice blog , its help you to remove rundll error , click this link and get a free from rundll error .How To Remove Rundll ErrorThank youAalia lyon ReplyDeleteAnonymousJuly 29, 2014 at 4:30 AMIt's perfect time to make some plans for the future and it is time to be happy.I'velearn this publish and if I mayy just I wieh to recommend you some attention-grabbing things or tips. Maybe yoou caan write subsequent arfticles relating too this article.I wish to rad more things approximately it!Here is my blog ... need for speed world hackReplyDeleteAnonymousAugust 1, 2014 at 11:45 AMThank you! This was very help