A
Ashish Kanoongo
I am generating a excel work sheet with various row and columns and filled with formulas and cell values.
When I tried thies application first time, it works perfect, the next time i get this error:
Method 'Cells' of object '_Global' failed
I have declare following code at the declaration section
Dim ExcelApp As Excel.Application
Dim ExcelSht As Excel.Worksheet
Dim ExcelWkb As Excel.Workbook
Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Visible = True
Set ExcelWkb = ExcelApp.Workbooks.Add
Set ExcelSht = ExcelWkb.Worksheets(1)
ExcelSht.Visible = xlSheetVisible
ExcelSht.PageSetup.PrintGridlines = True
ExcelSht.PageSetup.Orientation = xlLandscape
ExcelSht.PageSetup.CenterHeader = "Distrubution Sheet"
Billing_Advance ' Function for calucation and genrates values in row and column
At the end of the code I hv given following code
Set ExcelSht = Nothing
ExcelWkb.Close True
Set ExcelWkb = Nothing
ExcelApp.Quit
Set ExcelApp = Nothing
set ExcelWkb = nothing
set ExcelSht = nothing
set ExcelApp = nothing
But nothing happens
Let me know whats wrong I am doing or how do I handle this?
Ashish
When I tried thies application first time, it works perfect, the next time i get this error:
Method 'Cells' of object '_Global' failed
I have declare following code at the declaration section
Dim ExcelApp As Excel.Application
Dim ExcelSht As Excel.Worksheet
Dim ExcelWkb As Excel.Workbook
Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Visible = True
Set ExcelWkb = ExcelApp.Workbooks.Add
Set ExcelSht = ExcelWkb.Worksheets(1)
ExcelSht.Visible = xlSheetVisible
ExcelSht.PageSetup.PrintGridlines = True
ExcelSht.PageSetup.Orientation = xlLandscape
ExcelSht.PageSetup.CenterHeader = "Distrubution Sheet"
Billing_Advance ' Function for calucation and genrates values in row and column
At the end of the code I hv given following code
Set ExcelSht = Nothing
ExcelWkb.Close True
Set ExcelWkb = Nothing
ExcelApp.Quit
Set ExcelApp = Nothing
set ExcelWkb = nothing
set ExcelSht = nothing
set ExcelApp = nothing
But nothing happens
Let me know whats wrong I am doing or how do I handle this?
Ashish