Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 39

Thread: Com Error & Asp.net

  1. #11
    keroed1 Guest

    Default

    Quote Originally Posted by Offroad
    http://66.102.7.104/search?q=cache:M...n&ct=clnk&cd=1

    I believe that this is owc10 so I think you are correct that you need to update your new server or make your code backward compatable. Though I have no clue how you would do that or even if it is possible with what you want to do.

    Edit: So I agree agree with fatta77. I just was no where near as clear
    oh so you are saying jus download the owc10.msi and run it on the computer since is owc10 i used to create excel sheets that i am generating in my asp.net page so after i download owc10.msi jus run it on the machine cool, thanks guys i not physically at the machine but as soon as i get to the machine i going to do that

  2. #12
    keroed1 Guest

    Default

    guys i installed the owc on the machine but i got some errors. this tiome the excel file that i generated was opened but i get some jumbled information like this

    <?xml version="1.0"?>
    <ss:Workbook xmlns:x="urn:schemas-microsoft-comffice:excel"
    xmlns:ss="urn:schemas-microsoft-comffice:spreadsheet"
    xmlns:c="urn:schemas-microsoft-comffice:component:spreadsheet">
    <x:ExcelWorkbook>
    <x:ProtectStructure>False</x:ProtectStructure>
    <x:ActiveSheet>0</x:ActiveSheet>
    </x:ExcelWorkbook>
    <ss:Styles>
    <ss:Style ss:ID="Default">
    <ss:Alignment ss:Horizontal="Automatic" ss:Rotate="0.0" ss:Vertical="Bottom"
    ss:ReadingOrder="Context"/>
    <ss:Borders>
    </ss:Borders>
    <ss:Font ss:FontName="Arial" ss:Size="10" ss:Color="Automatic" ss:Bold="0"

  3. #13
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Quote Originally Posted by keroed1
    I am reading the page you sent me to but i am unsure of wati should do, initially in my code all i did was in my Mypage.aspx.vb i had this code

    Imports OWC10

    Sub ExportToExcel()
    ...
    end sub

    so i not tooo sure where i should be trying to put the "0002E510-0000-0000-C000-000000000046" u were telling me about
    Sorry, I mis-diagnosed the problem. You said that you had an asp.net error so I should have known that it was a server code problem and not a client code.

    guys i installed the owc on the machine but i got some errors. this tiome the excel file that i generated was opened but i get some jumbled information like this

    <?xml version="1.0"?>
    ...
    I am guessing this
    Code:
    xlSheet.Export("C:\Inetpub\wwwroot\CallAccounting\ Reports\Long Distance Calls\Long Distance Calls" & Stored_File_Name & ".xls", OWC10.SheetExportActionEnum.ssExportActionNone
    was the cause for the xml code.

    Did you use the help file for OWC10
    Office 2000 Spreadsheet Component Function Reference Help File
    Office XP Help File: Spreadsheet Component Help Update
    It would have reference on the export function
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  4. #14
    keroed1 Guest

    Default

    @crosswire
    i jus downloaded the help file thats teh second link u posted but while searching through the .chm file i never see anything that addresses how you would export it properly asp.net, but i dont really see naything......is it possible that u could show me a code snippet of how to export it properly

  5. #15
    Join Date
    May 2003
    Posts
    108
    Rep Power
    0

    Default

    I need to see the SQL statement in order to further diagnose.

    Here a piece of code i wrote before to read from an excel file; it may help.


    'connect to the Excel sheet
    Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & strFilename & ";" & _
    "Extended Properties=""Excel 8.0;"""

    'SQL for reading info from excel sheet. [Sheet1$] is the datasheet to read from. You can replace it with the name of your datasheet, but u must include the brackets[]/

    myData = New OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn)

    'read excel info into dataset from excel sheet.
    myData.Fill(myDataset)

    'you can then read from the dataset
    val = myDataset.Tables(0).Rows("ColumnName") ' replace "ColumnName" with the name of the Column on your excel sheet.

  6. #16
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    It seems that either html or xml are the only options for exporting.

    OWCVBA10.CHM

    or

    http://msdn.microsoft.com/library/en...asp?frame=true

    Code:
    Sub ExportSpreadsheet()
    
        Dim ssConstants
    
        Set ssConstants = Spreadsheet1.Constants
    
        Spreadsheet1.Export "ssheet1.htm", ssConstants.ssExportActionNone, _
            ssConstants.ssExportXMLSpreadsheet
    
    End Sub
    I copied the code from the CHM which I had on my machine before, so I am not sure it is in the download link I gave before.

    I am wondering if you can open your xml format file in Office Excel ?
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  7. #17
    keroed1 Guest

    Default

    this is the code snippet

    Dim xlSheet As SpreadsheetClass
    Dim numberCols As Integer

    xlSheet = New SpreadsheetClass

    conAcc = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA Source=" & Locate_Database() & " ")
    conAcc.Open()
    cmdSelect = New OleDbCommand(GetQuery(), conAcc)

    cmdSelect.Parameters.Add("@startdate", From_Date.Value)
    cmdSelect.Parameters.Add("@enddate", To_Date.Value)
    cmdSelect.Parameters.Add("@cst", Double.Parse(cost.Text))
    Dim dtrResults As OleDbDataReader = Me.cmdSelect.ExecuteReader()
    numberCols = dtrResults.FieldCount
    Dim row As Integer = 1
    Dim colCount As Integer = 0

    'write headings
    xlSheet.Cells(1, 1) = "Extension"
    xlSheet.Cells(1, 2) = "Code Used"
    row = 2

    While dtrResults.Read()
    Dim i As Integer = 0
    While i < numberCols
    If dtrResults.GetValue(i).ToString.IndexOf("!") > 0 Then
    Dim x As Integer
    x = dtrResults.GetValue(i).ToString().LastIndexOf("!")
    xlSheet.ActiveSheet.Cells(row, i + 1) = dtrResults.GetValue(i).ToString().Substring(0, x)
    Else
    xlSheet.ActiveSheet.Cells(row, i + 1) = dtrResults.GetValue(i).ToString()
    End If
    i += 1
    End While
    row += 1
    End While

    With xlSheet.Range("A1")
    .Font.Bold = True
    .Font.Color = "Blue"
    .EntireColumn.AutoFit()
    End With

    With xlSheet.Range("B1")
    .Font.Bold = True
    .Font.Color = "Blue"
    .EntireColumn.AutoFit()
    End With

    dtrResults.Close()
    conAcc.Close()

    Stored_File_Name = Name_File()
    lbl_location.Text = ("<a href='" + "\CallAccounting\Reports\Cost Calls\Cost Calls" & Stored_File_Name + ".xls" + "'>" + "Cost_Calls" + Stored_File_Name + ".xls")
    xlSheet.Export("C:\Inetpub\wwwroot\CallAccounting\ Reports\Cost Calls\Cost Calls" & Stored_File_Name & ".xls", OWC10.SheetExportActionEnum.ssExportActionNone)

  8. #18
    keroed1 Guest

    Default

    but the thing is on my machine that uses 2003 this code works perfectky find but the machine i carr it to not using 2003

  9. #19
    keroed1 Guest

    Default

    Quote Originally Posted by crosswire
    It seems that either html or xml are the only options for exporting.

    OWCVBA10.CHM

    or

    http://msdn.microsoft.com/library/en...asp?frame=true

    Code:
    Sub ExportSpreadsheet()
    
        Dim ssConstants
    
        Set ssConstants = Spreadsheet1.Constants
    
        Spreadsheet1.Export "ssheet1.htm", ssConstants.ssExportActionNone, _
            ssConstants.ssExportXMLSpreadsheet
    
    End Sub
    I copied the code from the CHM which I had on my machine before, so I am not sure it is in the download link I gave before.

    I am wondering if you can open your xml format file in Office Excel ?
    so wat u saying is that instead of this:
    xlSheet.Export("C:\Inetpub\wwwroot\CallAccounting\ Reports\Cost Calls\Cost Calls" & Stored_File_Name & ".xls", OWC10.SheetExportActionEnum.ssExportActionNone)

    i should prob have this:
    xlSheet.Export("C:\Inetpub\wwwroot\CallAccounting\ Reports\Cost Calls\Cost Calls" & Stored_File_Name & ".xls", xlSheet.ssExportActionNone, _
    xlSheet.ssExportXMLSpreadsheet)

    ???????????
    and this will make it work on any excl not jus excel 2003?????

  10. #20
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Both machines environments should produce the xml format of the spreedsheet given that code. Did you mean that you got some form of binary file on your machine?

    When you click on the link, "\CallAccounting\Reports\Cost Calls\Cost Calls" & Stored_File_Name + ".xls", Excel opens the file, perhaps your 2003 Version is configured to hadle that file extension, and the other machine uses IE to open that entension. That sounds weird. Have you downloaded the file on the 'other' machine and try to open it in Office Excel.

    You could try changing the extension to xml, as well, and then try Excel
    You could try using "data = xml / application = MS Access" for the content of the page if you try an htm extension, but I have read up on this
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •