Advertisement

03.21.2008 at 11:46PM PDT, ID: 23261162
[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!

Insert Value Into Named Cell/Range in Excel

Tags: Visual Basic, Type Mismatch Error 13 and Error 2029 in Excel debugger
I'm trying to insert a value in an Excel 2007 worksheet cell from a VB.NET 2008 application.  It looks like the value is being written into the cell correctly, however all the formulas that reference the cell are throwing #NAME? errors causing a type mismatch when looked at in the Excel debugger.  The cell I'm trying to set the value for is a named cell/range so I'm not sure if this is causing any of my issues or not, I'm referencing it in my VB application using "A3" style references.  Here's the code I'm using to try and set the value.

Any help is appreciated, I'm not sure what's wrong with this code.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
Public Sub SetExcel(ByVal xlFileName As String, _
                         ByVal xlWorksheet As String, _
                         ByVal xlCellName As String, _
                         ByVal xlCellContents As String)
 
        On Error GoTo SetExcel_Err
 
        ' Create the Excel App Object 
        xlApp = CreateObject("Excel.Application")
 
        ' Create the Excel Workbook Object
        xlBook = xlApp.Workbooks.Open(xlFileName)
 
        ' Set the value of the Cell 
        xlBook.Worksheets(xlWorksheet).Range(xlCellName) = xlCellContents
        ' Force a recalculation
        xlApp.CalculateFull()
 
        ' Save changes and close the spreadsheet 
        xlBook.Save()
        xlBook.Close()
        xlApp.Quit()
        xlApp = Nothing
        xlBook = Nothing
        GC.Collect()
        GC.WaitForPendingFinalizers()
        Exit Sub
SetExcel_Err:
        MsgBox("SetExcel Error: " & Err.Number & "-" & Err.Description)
        Resume Next
 
        GC.Collect()
        GC.WaitForPendingFinalizers()
        GC.Collect()
        GC.WaitForPendingFinalizers()
    End Sub
Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: JjcampNR
Solution Provided By: harfang
Participating Experts: 3
Solution Grade: A
Views: 309
Translate:
Loading Advertisement...
03.22.2008 at 12:08AM PDT, ID: 21185059

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.22.2008 at 09:20AM PDT, ID: 21186831

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.22.2008 at 12:38PM PDT, ID: 21187491

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.22.2008 at 12:51PM PDT, ID: 21187530

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.22.2008 at 12:53PM PDT, ID: 21187536

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.22.2008 at 08:46PM PDT, ID: 21188592

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.23.2008 at 09:51AM PDT, ID: 21190050

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.23.2008 at 09:19PM PDT, ID: 21191929

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.23.2008 at 09:29PM PDT, ID: 21191951

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.23.2008 at 09:51PM PDT, ID: 21192000

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.24.2008 at 07:23PM PDT, ID: 21199101

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.24.2008 at 07:56PM PDT, ID: 21199208

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.24.2008 at 10:56PM PDT, ID: 21199770

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.25.2008 at 03:28AM PDT, ID: 21200633

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.25.2008 at 06:56PM PDT, ID: 21208226

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628