OWC VB.NET - What am I doing wrong??

Microsoft OFFICE


  • 1. Setting XMLData does not set chart layout
    Hi, I was under the impression that the XMLData property of the pivottable was a read/write property. I have a (Access 2003) form which uses the PivotChart view. The Form_Load procedure contains code to set up the axis and labels - this works fine and gives me a "default view" of my data. Then I drag/drop fields into different chart areas, and then I click a Save button and write the XMLData to a table. Close the form and re-load it (default values loaded OK) and then try to apply the saved XMLData to re-load the chart I was viewing previously. The chart clears, but does not re-display with the saved settings. The code I am using to assign the XMLData is; Form_frmQueryViewer.PivotTable.XMLData = strLoadedXMLData How can I load a saved "chart view/layout" Thanks
  • 2. Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
    Hi, I am working with a conversion application from VB 6.0 to VB.NET 2005. I used Visual Studio 2005 for conversion of this VB 6.0 code. It's sussfully converted And Working fine in some devlopment systems. But in few systems (like, my development PC) an AxComCtlLib.dll is missing in Reference of .net Solutions automatically. I try to add AxComCtlLib.dll from bin to Reference of .net Solutions. Now project is Sucessfully compiling in my Development PC also and When I try to run the application I am getting below error in the InitializeComponent(). Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) Can anybody suggest me with the solution for this. Its very urgent for me. Please try to help me asap. Thanks in advance. Sreenivasulu.k

OWC VB.NET - What am I doing wrong??

Postby moremotivated » Wed, 18 May 2005 00:36:42 GMT

Hello, I am having trouble getting my code here to write out an
appropriate GIF image for a chart using the OWC components.  I am
calling the page as <img src ="theChartingPage.aspx"> , but am not
receiving the data back.

My original example worked ok, but I have done something here to mess
it up.  I do have the values coming from the database, but for
simplicity sake I am going to create a static array so we can eliminate
that from the potentional problem list.  Any help you can give would be
greatly appreciated!!

We will also assume the variables are all dimmed above.  I get no
runtime errors here just nothing for the value :/

        labelArray(0) = "Total"
        labelArray(1) = "Vacant"

        dataArray(0) = "1"
        dataArray(1) = "3"

        'Create a new chartspace:
        ChartSpace1 = New OWC.ChartSpace

        'Create a new chart within ChartSpace1:
        occupancyChart = ChartSpace1.Charts.Add(0)

        'Add a new dataseries within occupancyChart:
        occupancyChart_Series1 = occupancyChart.SeriesCollection.Add(0)

        'Define occupancyChart_Series1 as pie chart
        occupancyChart_Series1.Type =

        'Name the dataseries (name appears in Legend):

OWC.ChartSpecialDataSourcesEnum.chDataLiteral, "Chart1_Series1")

        'Populate values from array:

OWC.ChartSpecialDataSourcesEnum.chDataLiteral, labelArray)

OWC.ChartSpecialDataSourcesEnum.chDataLiteral, dataArray)

        'Format the chart elements.
        With occupancyChart
            .HasLegend = True
            .Legend.Position =
            .HasTitle = True
            .Title.Caption = "Total Occupancy For All Unit Types"
            .Axes(0).HasTitle = True
            .Axes(0).Title.Caption = "Total Units"
            .Axes(1).HasTitle = True
            .Axes(1).Title.Caption = "Total Vacant Units"
        End With

        'Return the new chart in GIF format.
        Response.Buffer = True
        Response.ContentType = "image/gif"
        Response.BinaryWrite(ChartSpace1.GetPicture("gif", 500, 400))

Re: OWC VB.NET - What am I doing wrong??

Postby moremotivated » Wed, 18 May 2005 02:10:35 GMT

Solved my own problem here, I was trying to set invalid properties to
the chart.  I've taken out the invalid entries in the With statement
for occupancyChart and everything seems fine now!

Similar Threads:

1.I am stupid and don't know what the heck I am doing wrong on t

2.VB code -- what am I doing wrong?

3.What am I doing wrong??

Here is what I am trying:

\Application Data", _
"C:\Documents and Settings\" & Environment.UserName & "\Application
Data\Adobe", True)
        MessageBox.Show("Done Resetting Application Data, Press OK to
Continue and reset Local Settings data", "Backup in progress...",
MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
\Local Settings", _
"C:\Documents and Settings\" & Environment.UserName & "\Local Settings
\Application Data\Adobe", True)
        MessageBox.Show("Done Resetting Local Settings data, Press OK
to Continue.", "Backup in progress...", MessageBoxButtons.OK,

I get the error that: \\server\all\sets\Application Data  is not
found, but it is there, and inside that folder I want to copy a folder
to c:\doc and set\user\application data\adobe

Also, will this work like this, one statement after another to do two


4.What am I doing wrong - Trying to update

I have enclosed the sample code that I created.  I want to read in employee 
data, and modify a few fields.  I have tried to globally declare the objects 
that I need but I still am having problems.  I want to update in a seperate 
subroutine and seem to have problems.  HELP please.

Public Class Form1

    Inherits System.Windows.Forms.Form
    Public cn As OleDb.OleDbConnection
    Public ds As DataSet
    Public da As OleDb.OleDbDataAdapter
    Public rowEmployee As DataRow

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles MyBase.Load

            Dim strConn As String
            strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data 

            Dim cn As New OleDb.OleDbConnection(strConn)

            Dim strSQL As String
            strSQL = "SELECT EmployeeID, FirstName, LastName, Address, City, 
Region, " & _
                "PostalCode from Employees ORDER BY LastName, FirstName"

            Dim da = New OleDb.OleDbDataAdapter(strSQL, strConn)
            Dim ds As New DataSet

            da.Fill(ds, "Employees")

            Dim tbl As DataTable = ds.Tables(0)

            'rowEmployee = New DataRow
            rowEmployee = tbl.Rows(0)
            txtFirstName.Text = rowEmployee("FirstName")
            txtLastName.Text = rowEmployee("LastName")
            txtAddress.Text = rowEmployee("Address")

        Catch ex As Exception
            MessageBox.Show(ex.Message & " :: " & ex.Source)
        End Try
    End Sub

    Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles btnUpdate.Click
            rowEmployee("LastName") = txtLastName.Text

        Catch ex As Exception

            MessageBox.Show(ex.Message & " :: " & ex.Source)

        End Try

    End Sub
End Class

When it runs I get the following error:

"Object reference not set to an instance of an object."

on the             da.Update(ds)       line in the btnUpdate_Click routine.




5.Project build problem - what am I doing wrong?

I have a program that needs to access a prewritten external data file
that is supplied with the program. I want to place this data file in

In the program's setup project I've done: Add Special Folder | User's
Application Data File, then within this created a folder called
MyProgramFolder, then Add File and pointed to a copy of my external
data file, which duly appears in the folder contents (EXCEPT that it
has a wavy line underneath!)

But unfortunately the resulting setup program does not install the
external data file where it should - in fact as far as I can see it
does not install it at all anywhere on the target PC.

Cany anyone advise what I'm doing wrong please? The fact that the file
entry has a wavy line underneath is presumably indicative of an error
but what's the cause and how do I fix it?


6. Table doesn't update - What am I doing wrong?

7. Newbe question, What am I doing wrong

8. Programatically getting a RichTextBox to scroll - What Am I doing Wrong

Return to Microsoft OFFICE


Who is online

Users browsing this forum: No registered users and 80 guest