ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SaveAs "subscript out of range" error (COM - SOAP) (https://www.excelbanter.com/excel-programming/271346-re-saveas-subscript-out-range-error-com-soap.html)

jaf

SaveAs "subscript out of range" error (COM - SOAP)
 
Did you paste that line?
Should be...
workbooks(1).SaveAs (pathFileName & FileName & ".xls")

workbooks (plural) and you left out the quotes around .xls.



--

John

johnf202 at hotmail dot com


"Matthia" wrote in message
...
Hi to all,
I receive this error n.9 "subscript out of range" when I try to SaveAs my

workbook on other file.

I close excel file on my isolated method on COM in visual basic (and then

I open my Excel file on
other COM method...).

If I try these methods by a simple client in VB I don't receive errors,

but I must use a java
application that communicate with my COM methods via SOAP, then when I use

these my COM go on that
error.

My code on error is:
Excel.Workbook(1).SaveAs (pathFileName & fileName & .xls)

I don't use my public workbook variable (example: xlWB) because strangely

this reference on other
methods result Nothing when used on Java - SOAP - COM - Excel, but work

great with VB client.

Please, help me, thanks to all.


--
--------------------------------------------------------------------------

----
Nick : Matthia
E-Mail :
IRC Nick : Matthia - Matt_WORK - Mat*
ICQ N. Casa : 136775978
ICQ N. Uff. : 133038922
--------------------------------------------------------------------------

----




All times are GMT +1. The time now is 04:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com