ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help Regarding SaveAs option in VB6 (https://www.excelbanter.com/excel-programming/355936-help-regarding-saveas-option-vb6.html)

SpiderSwamy

Help Regarding SaveAs option in VB6
 
Hi,
I am writing the following code to open an excel file if present
in
that path and want to save it with a different name using the Save As
option in vb6, the code is as below


sOutFol = App.Path
Set moApp = New excel.Application
On Error GoTo solution
moApp.Workbooks.Open (sOutFol & "\" & "output.xls")
moApp.Visible = True
Set mywb = moApp.Workbooks(1)


If (moApp.Visible = True) Then
mywb.Close
MsgBox " Save the Output.xls with other name and then click OK "
y = outputold.xls
FileName = mywb.SaveAs(y, ForReading)
Form2.Show


Any one who know what values to pass to the SaveAs function or please
give a piece of code which works for SaveAs function..


Thanks in Advance


Swamy


Henrich

Help Regarding SaveAs option in VB6
 
Hi, try this:

Application.Dialogs(xlDialogSaveAs).Show

Henrich

€žSpiderSwamy" napĂ*sal (napĂ*sala):

Hi,
I am writing the following code to open an excel file if present
in
that path and want to save it with a different name using the Save As
option in vb6, the code is as below


sOutFol = App.Path
Set moApp = New excel.Application
On Error GoTo solution
moApp.Workbooks.Open (sOutFol & "\" & "output.xls")
moApp.Visible = True
Set mywb = moApp.Workbooks(1)


If (moApp.Visible = True) Then
mywb.Close
MsgBox " Save the Output.xls with other name and then click OK "
y = outputold.xls
FileName = mywb.SaveAs(y, ForReading)
Form2.Show


Any one who know what values to pass to the SaveAs function or please
give a piece of code which works for SaveAs function..


Thanks in Advance


Swamy




All times are GMT +1. The time now is 01:52 AM.

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