Advertisement

05.17.2008 at 05:55PM PDT, ID: 23411301
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

How to resolve errors in Excel when using VBA objects ?

Asked by zimmer9 in Microsoft ADP, Microsoft Excel Spreadsheet Software, Access Coding/Macros

I am developing an Access application in Access 2003 using Access as the front end and SQL Server as the back end database.  The following subroutine titled StartDocLN works fine in my application.

Do you know how I could modify the SECOND subroutine that follows named Calc_subtotals
to use objects similar to those used in StartDocLN ?

I have encountered errors compiling Calc_subtotals.  
For ex: the compiler states that Method or data member not found for
Application.ScreenUpdating = False  <--- Compiler highlights Screenupdating  
--------------------------------------------------------------------------------------------------
Private Sub StartDocLN(filename)
 Dim xlApp As Excel.Application
 Dim xlWB As Excel.Workbook
 Dim xlWS As Excel.Worksheet
 Set xlApp = New Excel.Application
 xlApp.Visible = True
 Set xlWB = xlApp.Workbooks.Open(filename)
 Set xlWS = xlWB.Worksheets(1)
 xlWS.Columns.AutoFit
 xlApp.ScreenUpdating = True
End Sub
----------------------------------------------------------------------------------
Private Sub Calc_subtotals(filename)
Dim str As String
Dim lastrow As Long
Dim i As Long
Dim rng As Range
Dim celle As Range
Dim str1 As String
Dim str2 As String
Dim rowe As Long
Dim temp As Double
Application.ScreenUpdating = False
rowe = 2
str1 = "A"
str2 = "E"
With Sheets("Sheet1")
    Set rng = Range(.Cells(rowe, str1), .Cells(.Cells.Rows.count, str2).End(xlUp))
End With
 
rng.Sort Key1:=Range("C2"), Order1:=xlAscending, Key2:=Range("B2") _
        , Order2:=xlAscending, Key3:=Range("E2"), Order3:=xlAscending, Header:= _
        xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _
        xlSortNormal
str = "B"
With Sheets("Sheet1")
    lastrow = .Cells(.Cells.Rows.count, str).End(xlUp).Offset(1, 0).Row
 
For i = lastrow To 3 Step -1
    If .Cells(i, "B") <> .Cells(i - 1, "B") Then
        .Rows(i).Insert Shift:=xlDown
    End If
Next i
 
str = "B"
lastrow = .Cells(.Cells.Rows.count, str).End(xlUp).Offset(1, 0).Row
 
temp = 0
For i = 2 To lastrow
    temp = temp + Cells(i, 5)
    If Cells(i, 5) = "" Then
        Cells(i, 6) = temp
        temp = 0
        Cells(i, 1) = "Sub-total"
    End If
Next i
 
End With
 
Columns("F:F").NumberFormat = "#,##0.00"
 
Application.ScreenUpdating = True
 
End SubStart Free Trial
[+][-]05.17.2008 at 06:03PM PDT, ID: 21591245

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.17.2008 at 06:34PM PDT, ID: 21591280

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.17.2008 at 07:11PM PDT, ID: 21591355

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.17.2008 at 09:03PM PDT, ID: 21591558

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.17.2008 at 10:09PM PDT, ID: 21591632

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 07:35PM PDT, ID: 21594935

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft ADP, Microsoft Excel Spreadsheet Software, Access Coding/Macros
Sign Up Now!
Solution Provided By: zorvek
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628