Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rod Rod is offline
external usenet poster
 
Posts: 108
Default Excel._Worksheet.SaveAs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Excel._Worksheet.SaveAs

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   Report Post  
Posted to microsoft.public.excel.programming
Rod Rod is offline
external usenet poster
 
Posts: 108
Default Excel._Worksheet.SaveAs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excel._Worksheet.SaveAs

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   Report Post  
Posted to microsoft.public.excel.programming
Rod Rod is offline
external usenet poster
 
Posts: 108
Default Excel._Worksheet.SaveAs

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excel._Worksheet.SaveAs

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   Report Post  
Posted to microsoft.public.excel.programming
Rod Rod is offline
external usenet poster
 
Posts: 108
Default Excel._Worksheet.SaveAs

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Method 'MailEnvelope' of object '_Worksheet' failed [email protected] Excel Discussion (Misc queries) 1 December 7th 05 11:20 PM
Method 'MailEnvelope' of object '_Worksheet' failed [email protected] Excel Programming 1 December 7th 05 02:23 PM
Methode 'Cells' of object '_Worksheet' failed Filips Benoit Excel Programming 1 January 16th 05 10:48 AM
Method 'Paste' of object '_worksheet' failed Greg Bloom Excel Programming 4 October 18th 04 06:19 PM
HELP!!!! -- (Method Range of _Worksheet failed) ERROR! Fusion[_2_] Excel Programming 4 November 24th 03 03:32 PM


All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"