I try it again. Howto. Proposed Filename and path different by the default with VBA

F

Fabian

Hi all,

I submit again my issue because I have not managed to make myself
understood yesterday.

I have a macro that is lauched by MsAccess and among the other things,
it opens an Excel workbook formatted by the template ExcelTemp.xlt I
programmatically open the workbook with.

The workbook consists of a list of costs/prices and totals. When the
macro ends, the Excel sheet needs to remain Open and Active for the
user to check/complete the workbook and save it,manually. So, file
saving is not made by the macro automaticallybut by the user.

Now, Excel proposes a default filename (in the titlebar) as the
filename of the template plus 1 ( template = ExcelTemp.xlt -> proposed
filename: ExcelTemp1.xls) and the destination directory, the same of
the template.

Now, I would like to be able to let Excel propose a filename and path
to save the file to different by these: they should both be the same of
the MsAccess database (but filename with extension xls, of course).

How can I programmatically command Excel to "propose" different
filename and path than the default ones? My goalis to let the user
csimply click on save and the file is already saved in the right
directory with the right name.

Thank you.
Fabian
 
N

NickHK

Fabian,
In the _BeforeSave event, show your own dialog with your desired defaults.
Save the file.

Cancel=true

So you only do this the first time, it is probably good to check the
..Path="".

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top