Click here to Skip to main content
15,897,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Changing date format Pin
Ahamed Azeem22-Aug-07 2:12
Ahamed Azeem22-Aug-07 2:12 
AnswerRe: Changing date format Pin
ejaz_pk22-Aug-07 1:16
ejaz_pk22-Aug-07 1:16 
AnswerRe: Changing date format Pin
Salman Sheikh22-Aug-07 1:22
Salman Sheikh22-Aug-07 1:22 
GeneralRe: Changing date format Pin
Ahamed Azeem22-Aug-07 2:15
Ahamed Azeem22-Aug-07 2:15 
GeneralRe: Changing date format Pin
Salman Sheikh28-Aug-07 0:23
Salman Sheikh28-Aug-07 0:23 
QuestionSort of Mail Merge Application Pin
Trupti Mehta21-Aug-07 23:44
Trupti Mehta21-Aug-07 23:44 
QuestionHow to avoid html tag in body of mail while saving to db. Pin
rahul.net1121-Aug-07 23:40
rahul.net1121-Aug-07 23:40 
QuestionNeed help here Pin
dienadel21-Aug-07 23:05
dienadel21-Aug-07 23:05 
Hi,

I have been receiving this error to a program im developing and I cant figure out what it is.
Can anyone help me its urgent.

I have added a new sheet on an xlt file and add it to the code which is:

Public Sub Survey_1(ByVal report As String)

Dim stored_func() As String = { _
"[Production charts - Survey_1 - Export prices]", _
"[Production charts - Survey_1 - Export Price increase]", _
"[Production charts - Survey_1 - Export Price decrease]", _ <-- this one
"[Production charts - Survey_1 - Price increase by product]", _
"[Production charts - Survey_1 - Price increase by location]", _
"[Production charts - Survey_1 - Capacity]", _
"[Production charts - Survey_1 - Capacity expansion]"}
CreateReport(stored_func, report)

End Sub

Im getting the error on this side of the code:

Dim db1 As New DbTier
db1.DbSource = GetSetting("Server", "Data Source", "CSR", "")
db1.OpenConnection()

Dim i As Integer

Dim wb As Workbook = mvarExcel.Workbooks.Open(mvarTemplate)
Dim ws As Worksheet
Dim rg As Excel.Range
Dim drd As OleDb.OleDbDataReader

For i = LBound(stored_func) To UBound(stored_func)

ws = wb.Worksheets(i + 1)
rg = ws.Range("DATA" & i + 1) < ---- bug here
rg.ClearContents()

If i = 0 Then ws.Range("csr_title").Value = mvarCsrDetails(CsrIndex.Title)
drd = GetDataReader(db1, stored_func(i), mvarCsrDetails(CsrIndex.ID))

Dim r As Integer = 0
Dim c As Integer

While (drd.Read())
r += 1
For c = 0 To drd.FieldCount - 1
rg.Cells(r, c + 1) = drd(c)
RaiseEvent OnAfterEachProcess(stored_func(i))
Next c
End While

Call AdjustRange(ws, "COL1S" & i + 1, False)
Call AdjustRange(ws, "COL2S" & i + 1, True)

drd.Close()

Next

drd = Nothing
db1.CloseConnection()
db1 = Nothing

RaiseEvent OnAfterProcessDone("Saving " & report & ".")
Dim fleOutput As String = mvarOutputPath & UCase(mvarCsrDetails(CsrIndex.Title)) & " " & report & ".xls"
If File.Exists(fleOutput) Then File.Delete(fleOutput)
wb.SaveAs(fleOutput)
wb.Close(False)

the error says:

system.runtime.interopservices.COMException' occured in server2.2.exe

additional information: Exception from HRESULT: 0x800A03EC
AnswerRe: Need help here Pin
Paul Conrad26-Aug-07 9:30
professionalPaul Conrad26-Aug-07 9:30 
QuestionIP Address of computers on a network Pin
plural21-Aug-07 22:25
plural21-Aug-07 22:25 
AnswerRe: IP Address of computers on a network Pin
Wlink21-Aug-07 22:39
Wlink21-Aug-07 22:39 
GeneralRe: IP Address of computers on a network Pin
plural21-Aug-07 22:47
plural21-Aug-07 22:47 
GeneralRe: IP Address of computers on a network Pin
plural21-Aug-07 22:48
plural21-Aug-07 22:48 
GeneralRe: IP Address of computers on a network Pin
Wlink21-Aug-07 22:57
Wlink21-Aug-07 22:57 
AnswerRe: IP Address of computers on a network Pin
koolprasad200321-Aug-07 22:50
professionalkoolprasad200321-Aug-07 22:50 
GeneralRe: IP Address of computers on a network Pin
plural21-Aug-07 22:57
plural21-Aug-07 22:57 
GeneralRe: IP Address of computers on a network Pin
koolprasad200321-Aug-07 23:01
professionalkoolprasad200321-Aug-07 23:01 
GeneralRe: IP Address of computers on a network Pin
plural21-Aug-07 23:05
plural21-Aug-07 23:05 
GeneralRe: IP Address of computers on a network Pin
plural21-Aug-07 23:18
plural21-Aug-07 23:18 
GeneralRe: IP Address of computers on a network Pin
SimulationofSai21-Aug-07 23:31
SimulationofSai21-Aug-07 23:31 
GeneralRe: IP Address of computers on a network Pin
plural21-Aug-07 23:38
plural21-Aug-07 23:38 
GeneralRe: IP Address of computers on a network Pin
SimulationofSai21-Aug-07 23:50
SimulationofSai21-Aug-07 23:50 
GeneralRe: IP Address of computers on a network Pin
plural22-Aug-07 0:41
plural22-Aug-07 0:41 
GeneralRe: IP Address of computers on a network Pin
SimulationofSai22-Aug-07 1:02
SimulationofSai22-Aug-07 1:02 
GeneralRe: IP Address of computers on a network Pin
plural22-Aug-07 1:36
plural22-Aug-07 1:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.