Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2008, 12:54 PM
Registered User
 
Join Date: Jul 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Simple file path code

I have this:

Code:
  ActiveWorkbook.SaveAs Filename:=Format(Date, "yy-mm-") &
 Worksheets("Blank").Range("A1").Value


And This:

Code:
    ActiveWorkbook.Save
I want to know how to properly insert a path so it will save to that
whenever I choose to click one or the other. It would be nice if
the actual window box opened up like when you normally save a file so
you can change that path if you wanted, but that isn't needed if it
is beyond very basic code. I do want to dictate the name of the
saved file. The "saved as" file should be: Date, "yy-mm-") &
Worksheets("Blank").Range("A1").Value

But the ActiveWorkbook.save I just want to save the same file to
itself, accepting whatever data changes I have made, but no changes
to the actual file name.

Thanks!

 
Old July 31st, 2008, 02:22 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Try using Application.FileDialog(msoFileDialogSaveAs).Show

This will show a SaveAs dialog. Looking further on the net should reveal additional features.
(For instance you can also use Application.FileDialog(msoFileDialogOpen).Show
 and Application.FileDialog(msoFileDialogFilePicker). Perhaps picker would be best for you, and then you would use the results to save in code, as you have been doing...)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Very Simple code Tal1481 Beginning VB 6 9 January 29th, 2007 11:12 AM
Very Simple code Tal1481 Visual Basic 2005 Basics 1 January 25th, 2007 07:15 AM
Getting path of the file zorglub76 C# 4 December 23rd, 2005 04:25 AM
Get File path maxpotters Excel VBA 4 April 6th, 2005 01:19 PM
How to get the File Path DarthSith ASP.NET 1.0 and 1.1 Basics 2 October 29th, 2004 02:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.