Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The applicacion sends me the next message "Method not found:
Excel._Worksheet.SaveAs (..." I thinks that its about permissions but I do not know how to fix it. I have the same source in two different servers, It work in one of these but it doesn's work in the second one. oExcel = New Excel.Application oExcel.Visible = False : oExcel.DisplayAlerts = False 'Start a new workbook oBooks = oExcel.Workbooks oBooks.Open(sTemplate) ...... oSheet.SaveAs(sFile) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheets do not have a save or save as method. The workbook has those methods...
-- HTH... Jim Thomlinson "Rod" wrote: The applicacion sends me the next message "Method not found: Excel._Worksheet.SaveAs (..." I thinks that its about permissions but I do not know how to fix it. I have the same source in two different servers, It work in one of these but it doesn's work in the second one. oExcel = New Excel.Application oExcel.Visible = False : oExcel.DisplayAlerts = False 'Start a new workbook oBooks = oExcel.Workbooks oBooks.Open(sTemplate) ..... oSheet.SaveAs(sFile) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I just wrote the lines that have the problem, as I told you It works in one
server but when a try in another server the page send the error with the methods Open() and SaveAs(), I will apreciate your help "Jim Thomlinson" wrote: Sheets do not have a save or save as method. The workbook has those methods... -- HTH... Jim Thomlinson "Rod" wrote: The applicacion sends me the next message "Method not found: Excel._Worksheet.SaveAs (..." I thinks that its about permissions but I do not know how to fix it. I have the same source in two different servers, It work in one of these but it doesn's work in the second one. oExcel = New Excel.Application oExcel.Visible = False : oExcel.DisplayAlerts = False 'Start a new workbook oBooks = oExcel.Workbooks oBooks.Open(sTemplate) ..... oSheet.SaveAs(sFile) |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheets do not have a save or save as method.
Actually, worksheets do have a SaveAs method, Jim. Seems to save the entire workbook though so I have no idea why it exists. -- Jim "Jim Thomlinson" wrote in message ... Sheets do not have a save or save as method. The workbook has those methods... -- HTH... Jim Thomlinson "Rod" wrote: The applicacion sends me the next message "Method not found: Excel._Worksheet.SaveAs (..." I thinks that its about permissions but I do not know how to fix it. I have the same source in two different servers, It work in one of these but it doesn's work in the second one. oExcel = New Excel.Application oExcel.Visible = False : oExcel.DisplayAlerts = False 'Start a new workbook oBooks = oExcel.Workbooks oBooks.Open(sTemplate) ..... oSheet.SaveAs(sFile) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is my source and it works well in one machine, but I recieve the next
error message on my production server Method not found: Void Excel._Worksheet.SaveAs(.... '' Creamos un objeto Excel Dim oExcel As Excel.Application Dim oBooks As Excel.Workbooks, oBook As Excel.Workbook Dim oSheets As Excel.Sheets, oSheet As Excel.Worksheet Dim oCells As Excel.Range Dim sFile As String, sTemplate As String Dim ds As DataSet Dim iCodigoError As Integer Dim i, j, iCuantas, iAuxiliar, iPosicion As Integer Dim sRango1, sRango2, sLetra As String 'Dim p As System.Diagnostics.Process = New System.Diagnostics.Process Dim vCultura As System.Globalization.CultureInfo = System.Threading.Thread.CurrentThread.CurrentCultu re Dim dsBitacora As DataSet Try 'idInstitucion = 9 'idDisposicion = "BANORTE0002" 'idCartera = "E" 'Se establece en inglés la información regional para el 'subproceso actual antes de crear una instancia de Excel System.Threading.Thread.CurrentThread.CurrentCultu re = System.Globalization.CultureInfo.CreateSpecificCul ture("en-US") i = 1 'asigna rutas para la busqueda del xls base sFile = Server.MapPath("") iPosicion = sFile.LastIndexOf(objSeguridad.NombreSitio & "\") sTemplate = sFile.Substring(0, iPosicion) & objSeguridad.NombreSitio & "\LibrosExcel\base\MyTemplate.xls" sFile = sFile.Substring(0, iPosicion) & objSeguridad.NombreSitio & "\LibrosExcel\MyExcel.xls" sSql = "Select cl.Descripcion, cc.idCampo from oCesionLayoutInstitucion cl, cCamposLayoutCesion cc " & _ "where cl.idInstitucion=" & idInstitucion & _ "and cl.IndicadorTipoCartera='" & idCartera & "' and cc.idCampo=cl.idCampo " & _ "Order by Orden" objLector = objAccesaBD.fsqldrLeeBD(sSql) If objLector.HasRows = True Then ds = objCesion.fdsCesionCreaLayout(idInstitucion, idDisposicion, idCartera) If Not ds Is Nothing Then If ds.Tables(0).Rows.Count < 0 Then oExcel = New Excel.Application 'oExcel.Visible = True oExcel.Visible = False : oExcel.DisplayAlerts = False 'Start a new workbook oBooks = oExcel.Workbooks oBooks.Open(sTemplate) oBook = oBooks.Item(1) oSheets = oBook.Worksheets oSheet = CType(oSheets.Item(1), Excel.Worksheet) 'oBook = oExcel.Workbooks.Add 'oSheet = oBook.Worksheets(1) 'oSheet.Visible = Excel.XlSheetVisibility.xlSheetVisible 'oSheet.Activate() oSheet.Name = idDisposicion oCells = oSheet.Cells 'Campos para cabeceras iCuantas = ds.Tables(0).Rows.Count - 1 If iCuantas = 0 Then iCuantas = 1 While objLector.Read oSheet.Cells(1, i) = objLector.GetValue(0) iAuxiliar = objLector.GetValue(1) If fFormatoNumero(iAuxiliar) Then sLetra = fEquivalenteLetra(i) sRango1 = sLetra & 2 sRango2 = sLetra & iCuantas oCells = oSheet.Range(sRango1, sRango2) oCells.EntireColumn.NumberFormat = "###,###,##0.00" End If i = i + 1 End While Else sError = "No existen datos." Err.Raise(1) End If For i = 0 To ds.Tables(0).Rows.Count - 1 For j = 0 To ds.Tables(0).Columns.Count - 1 If i = 0 Then i = 1 oSheet.Cells(i + 1, j + 1) = ds.Tables(0).Rows(i - 1).ItemArray(j) i = 0 Else oSheet.Cells(i + 2, j + 1) = ds.Tables(0).Rows(i).ItemArray(j) End If Next Next Else sError = "Error en la generación del layout." Err.Raise(1) End If Else sError = "No existe configuración para el layout." Err.Raise(1) End If ' Bitacora dsBitacora = objAdministracion.fdsBitacora(Session("ClaveUsuari o"), "Cesión -- Exportar", "E", " Institución: " & CStr(idInstitucion) & " Disposición: " & idDisposicion & " Cartera : " & CStr(idCartera), 0) oSheet.SaveAs(sFile) 'Salva el archivo nuevo en LibrosExcel |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't do VB.NET and I don't know why it works on one machine and not
another. My only suggestion is to replace oSheet with oBook: oBook.SaveAs(sFile) -- Jim "Rod" wrote in message ... | There is my source and it works well in one machine, but I recieve the next | error message on my production server | | Method not found: Void Excel._Worksheet.SaveAs(.... | | | '' Creamos un objeto Excel | Dim oExcel As Excel.Application | Dim oBooks As Excel.Workbooks, oBook As Excel.Workbook | Dim oSheets As Excel.Sheets, oSheet As Excel.Worksheet | Dim oCells As Excel.Range | Dim sFile As String, sTemplate As String | | Dim ds As DataSet | Dim iCodigoError As Integer | Dim i, j, iCuantas, iAuxiliar, iPosicion As Integer | Dim sRango1, sRango2, sLetra As String | 'Dim p As System.Diagnostics.Process = New System.Diagnostics.Process | Dim vCultura As System.Globalization.CultureInfo = | System.Threading.Thread.CurrentThread.CurrentCultu re | Dim dsBitacora As DataSet | Try | 'idInstitucion = 9 | 'idDisposicion = "BANORTE0002" | 'idCartera = "E" | | 'Se establece en inglés la información regional para el | 'subproceso actual antes de crear una instancia de Excel | System.Threading.Thread.CurrentThread.CurrentCultu re = | System.Globalization.CultureInfo.CreateSpecificCul ture("en-US") | | i = 1 | 'asigna rutas para la busqueda del xls base | sFile = Server.MapPath("") | iPosicion = sFile.LastIndexOf(objSeguridad.NombreSitio & "\") | sTemplate = sFile.Substring(0, iPosicion) & | objSeguridad.NombreSitio & "\LibrosExcel\base\MyTemplate.xls" | sFile = sFile.Substring(0, iPosicion) & objSeguridad.NombreSitio | & "\LibrosExcel\MyExcel.xls" | | sSql = "Select cl.Descripcion, cc.idCampo from | oCesionLayoutInstitucion cl, cCamposLayoutCesion cc " & _ | "where cl.idInstitucion=" & idInstitucion & _ | "and cl.IndicadorTipoCartera='" & idCartera & "' and | cc.idCampo=cl.idCampo " & _ | "Order by Orden" | objLector = objAccesaBD.fsqldrLeeBD(sSql) | If objLector.HasRows = True Then | ds = objCesion.fdsCesionCreaLayout(idInstitucion, | idDisposicion, idCartera) | If Not ds Is Nothing Then | If ds.Tables(0).Rows.Count < 0 Then | oExcel = New Excel.Application | 'oExcel.Visible = True | oExcel.Visible = False : oExcel.DisplayAlerts = False | 'Start a new workbook | oBooks = oExcel.Workbooks | oBooks.Open(sTemplate) | oBook = oBooks.Item(1) | oSheets = oBook.Worksheets | oSheet = CType(oSheets.Item(1), Excel.Worksheet) | 'oBook = oExcel.Workbooks.Add | 'oSheet = oBook.Worksheets(1) | 'oSheet.Visible = | Excel.XlSheetVisibility.xlSheetVisible | 'oSheet.Activate() | oSheet.Name = idDisposicion | oCells = oSheet.Cells | | 'Campos para cabeceras | iCuantas = ds.Tables(0).Rows.Count - 1 | If iCuantas = 0 Then iCuantas = 1 | | While objLector.Read | oSheet.Cells(1, i) = objLector.GetValue(0) | iAuxiliar = objLector.GetValue(1) | If fFormatoNumero(iAuxiliar) Then | sLetra = fEquivalenteLetra(i) | sRango1 = sLetra & 2 | | sRango2 = sLetra & iCuantas | | oCells = oSheet.Range(sRango1, sRango2) | oCells.EntireColumn.NumberFormat = | "###,###,##0.00" | End If | i = i + 1 | End While | Else | sError = "No existen datos." | Err.Raise(1) | End If | For i = 0 To ds.Tables(0).Rows.Count - 1 | For j = 0 To ds.Tables(0).Columns.Count - 1 | If i = 0 Then | i = 1 | oSheet.Cells(i + 1, j + 1) = | ds.Tables(0).Rows(i - 1).ItemArray(j) | i = 0 | Else | oSheet.Cells(i + 2, j + 1) = | ds.Tables(0).Rows(i).ItemArray(j) | End If | Next | Next | Else | sError = "Error en la generación del layout." | Err.Raise(1) | End If | Else | sError = "No existe configuración para el layout." | Err.Raise(1) | End If | ' Bitacora | dsBitacora = | objAdministracion.fdsBitacora(Session("ClaveUsuari o"), "Cesión -- Exportar", | "E", " Institución: " & CStr(idInstitucion) & " Disposición: " & | idDisposicion & " Cartera : " & CStr(idCartera), 0) | | oSheet.SaveAs(sFile) 'Salva el archivo nuevo en LibrosExcel |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your help.
But I have the same problem with the Open() method. oBooks.Open(sTemplate) "Jim Rech" wrote: I don't do VB.NET and I don't know why it works on one machine and not another. My only suggestion is to replace oSheet with oBook: oBook.SaveAs(sFile) -- Jim "Rod" wrote in message ... | There is my source and it works well in one machine, but I recieve the next | error message on my production server | | Method not found: Void Excel._Worksheet.SaveAs(.... | | | '' Creamos un objeto Excel | Dim oExcel As Excel.Application | Dim oBooks As Excel.Workbooks, oBook As Excel.Workbook | Dim oSheets As Excel.Sheets, oSheet As Excel.Worksheet | Dim oCells As Excel.Range | Dim sFile As String, sTemplate As String | | Dim ds As DataSet | Dim iCodigoError As Integer | Dim i, j, iCuantas, iAuxiliar, iPosicion As Integer | Dim sRango1, sRango2, sLetra As String | 'Dim p As System.Diagnostics.Process = New System.Diagnostics.Process | Dim vCultura As System.Globalization.CultureInfo = | System.Threading.Thread.CurrentThread.CurrentCultu re | Dim dsBitacora As DataSet | Try | 'idInstitucion = 9 | 'idDisposicion = "BANORTE0002" | 'idCartera = "E" | | 'Se establece en inglés la información regional para el | 'subproceso actual antes de crear una instancia de Excel | System.Threading.Thread.CurrentThread.CurrentCultu re = | System.Globalization.CultureInfo.CreateSpecificCul ture("en-US") | | i = 1 | 'asigna rutas para la busqueda del xls base | sFile = Server.MapPath("") | iPosicion = sFile.LastIndexOf(objSeguridad.NombreSitio & "\") | sTemplate = sFile.Substring(0, iPosicion) & | objSeguridad.NombreSitio & "\LibrosExcel\base\MyTemplate.xls" | sFile = sFile.Substring(0, iPosicion) & objSeguridad.NombreSitio | & "\LibrosExcel\MyExcel.xls" | | sSql = "Select cl.Descripcion, cc.idCampo from | oCesionLayoutInstitucion cl, cCamposLayoutCesion cc " & _ | "where cl.idInstitucion=" & idInstitucion & _ | "and cl.IndicadorTipoCartera='" & idCartera & "' and | cc.idCampo=cl.idCampo " & _ | "Order by Orden" | objLector = objAccesaBD.fsqldrLeeBD(sSql) | If objLector.HasRows = True Then | ds = objCesion.fdsCesionCreaLayout(idInstitucion, | idDisposicion, idCartera) | If Not ds Is Nothing Then | If ds.Tables(0).Rows.Count < 0 Then | oExcel = New Excel.Application | 'oExcel.Visible = True | oExcel.Visible = False : oExcel.DisplayAlerts = False | 'Start a new workbook | oBooks = oExcel.Workbooks | oBooks.Open(sTemplate) | oBook = oBooks.Item(1) | oSheets = oBook.Worksheets | oSheet = CType(oSheets.Item(1), Excel.Worksheet) | 'oBook = oExcel.Workbooks.Add | 'oSheet = oBook.Worksheets(1) | 'oSheet.Visible = | Excel.XlSheetVisibility.xlSheetVisible | 'oSheet.Activate() | oSheet.Name = idDisposicion | oCells = oSheet.Cells | | 'Campos para cabeceras | iCuantas = ds.Tables(0).Rows.Count - 1 | If iCuantas = 0 Then iCuantas = 1 | | While objLector.Read | oSheet.Cells(1, i) = objLector.GetValue(0) | iAuxiliar = objLector.GetValue(1) | If fFormatoNumero(iAuxiliar) Then | sLetra = fEquivalenteLetra(i) | sRango1 = sLetra & 2 | | sRango2 = sLetra & iCuantas | | oCells = oSheet.Range(sRango1, sRango2) | oCells.EntireColumn.NumberFormat = | "###,###,##0.00" | End If | i = i + 1 | End While | Else | sError = "No existen datos." | Err.Raise(1) | End If | For i = 0 To ds.Tables(0).Rows.Count - 1 | For j = 0 To ds.Tables(0).Columns.Count - 1 | If i = 0 Then | i = 1 | oSheet.Cells(i + 1, j + 1) = | ds.Tables(0).Rows(i - 1).ItemArray(j) | i = 0 | Else | oSheet.Cells(i + 2, j + 1) = | ds.Tables(0).Rows(i).ItemArray(j) | End If | Next | Next | Else | sError = "Error en la generación del layout." | Err.Raise(1) | End If | Else | sError = "No existe configuración para el layout." | Err.Raise(1) | End If | ' Bitacora | dsBitacora = | objAdministracion.fdsBitacora(Session("ClaveUsuari o"), "Cesión -- Exportar", | "E", " Institución: " & CStr(idInstitucion) & " Disposición: " & | idDisposicion & " Cartera : " & CStr(idCartera), 0) | | oSheet.SaveAs(sFile) 'Salva el archivo nuevo en LibrosExcel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Method 'MailEnvelope' of object '_Worksheet' failed | Excel Discussion (Misc queries) | |||
Method 'MailEnvelope' of object '_Worksheet' failed | Excel Programming | |||
Methode 'Cells' of object '_Worksheet' failed | Excel Programming | |||
Method 'Paste' of object '_worksheet' failed | Excel Programming | |||
HELP!!!! -- (Method Range of _Worksheet failed) ERROR! | Excel Programming |