Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old Car
 
Posts: n/a
Default 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.


  #2   Report Post  
zackb
 
Posts: n/a
Default

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.




  #3   Report Post  
Jim Thomlinson
 
Posts: n/a
Default

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.



  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

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.




  #5   Report Post  
Old Car
 
Posts: n/a
Default

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.





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
Saving workbook with todays date sd look Excel Discussion (Misc queries) 1 April 28th 05 09:22 AM
problem saving workbook to network location eddie Excel Discussion (Misc queries) 0 April 14th 05 09:28 PM
Saving a Workbook Dennis Excel Worksheet Functions 1 February 22nd 05 01:03 PM
Why does Excel 2003 freeze when saving a workbook that has importe NeedToKnow Excel Worksheet Functions 0 February 18th 05 10:07 PM
Saving as web page for workbook with frozen panes tawne Excel Discussion (Misc queries) 0 January 19th 05 07:47 PM


All times are GMT +1. The time now is 05:59 AM.

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

About Us

"It's about Microsoft Excel"