ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving workbook from VB (https://www.excelbanter.com/excel-programming/328468-saving-workbook-vbulletin.html)

Old Car

Saving workbook from VB
 
How can I effectively do a "save" or "save as" of a workbood from VB. I
assume there are methods that support this. Thanks.



zackb[_2_]

Saving workbook from VB
 
Hi,

Do you mean, VBA? Visual Basic is NOT the same as Visual Basic for
Applications. VB < VBA. If you are talking the programming language in
which Excel has and is able to utilize, you're talking VBA. VB is a stand
alone program which is a little more versatile than VBA. A google search
will yield many results.

But if you are asking about VBA, then try the following ...

Sub testingSave()
Thisworkbook.Save
End sub

or..

Sub testingSaveAs()
Thisworkbook.SaveAs "C:\MyWorkbook.xls"
End sub

Is this what you're talking about?

--
Regards,
Zack Barresse, aka firefytr


"Old Car" wrote in message
news:uEwce.90$r81.40@trnddc02...
How can I effectively do a "save" or "save as" of a workbood from VB. I
assume there are methods that support this. Thanks.





Jim Thomlinson[_3_]

Saving workbook from VB
 
All of these are possible solutions... Depends exactly what you want...

ThisWorkbook.Save
ThisWorkbook.SaveAs "C:\Test.xls"
ThisWorkbook.SaveCopyAs "C:\test.xls"
Application.Dialogs(xlDialogSaveAs).Show "C:\Test.xls"
Application.Dialogs(xlDialogSaveCopyAs).Show "C:\Test.xls"

HTH

Thisworkbook.

"Old Car" wrote:

How can I effectively do a "save" or "save as" of a workbood from VB. I
assume there are methods that support this. Thanks.




Bob Phillips[_6_]

Saving workbook from VB
 
Assuming you mean VBA, Save and SaveAs are detailed in help.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Old Car" wrote in message
news:uEwce.90$r81.40@trnddc02...
How can I effectively do a "save" or "save as" of a workbood from VB. I
assume there are methods that support this. Thanks.





Old Car

Saving workbook from VB
 
Application.Dialogs(xlDialogSaveCopyAs).Show "C:\Test.xls"

gives me a run-time error.

Run-time error '1004':
Application-defined or object-defined error.

Does you know why? Thanks.

"Jim Thomlinson" wrote in message
...
All of these are possible solutions... Depends exactly what you want...

ThisWorkbook.Save
ThisWorkbook.SaveAs "C:\Test.xls"
ThisWorkbook.SaveCopyAs "C:\test.xls"
Application.Dialogs(xlDialogSaveAs).Show "C:\Test.xls"
Application.Dialogs(xlDialogSaveCopyAs).Show "C:\Test.xls"

HTH

Thisworkbook.

"Old Car" wrote:

How can I effectively do a "save" or "save as" of a workbood from VB. I
assume there are methods that support this. Thanks.







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

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