[AccessD] Use of Application.FileDialog(msoFileDialogSaveAs) in Access 2007

Stuart McLachlan stuart at lexacorp.com.pg
Sat Jan 22 17:10:51 CST 2011


Using my function with the  API call  works fine in  A2010 on 64 bit Windows 7 as well as 
earlier versions/OSs as long as you do this:

#If VBA7 Then
Declare PtrSafe Function GetOpenFileName Lib "comdlg32.dll" Alias _
        "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
#Else
Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
        "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
#End If


-- 
Stuart

On 22 Jan 2011 at 11:08, Charlotte Foust wrote:

> The API call should continue to work, at least for 32 bit environment
> (I haven't worked with 64-bit API).  I've used it in all versions of
> Access from 97 through 2007 without problems.
> 
> Charlotte Foust
> 
> On Fri, Jan 21, 2011 at 12:03 PM, Brad Marks
> <BradM at blackforestltd.com> wrote: > Charlotte, > > Yes, in my initial
> tests, it appears to work nicely. > > I am just a little hesitant to
> go forward with this approach if there is another approach that is a
> better path to follow. > > This is my first attempt at using
> Application.FileDialog and I would like to get started on the right
> foot. > > Thanks, > Brad > > > > -----Original Message----- > From:
> accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte
> Foust > Sent: Friday, January 21, 2011 10:58 AM > To: Access
> Developers discussion and problem solving > Subject: Re: [AccessD] Use
> of Application.FileDialog(msoFileDialogSaveAs) in Access 2007 > > Um,
> didn't you just say it seems to work?  Anymore, there are no bets >
> going forward, since MS decided to limit backwards compatibility. > >
> Charlotte Foust > > On Fri, Jan 21, 2011 at 7:55 AM, Brad Marks
> <BradM at blackforestltd.com> wrote: >> All, >> >> I have just started to
> experiment with Application.FileDialog(msoFileDialogSaveAs). >> >> We
> have an Access 2007 application that uses "DoCmd.TransferSpreadsheet"
> to generate several Excel files from Access Queries.  Currently this
> application has the name of the Excel file "hard coded" in the
> application. >> >> I would like to give our end-users the option of
> changing the name of the Excel file (and folder name) when the file is
> generated. >> >> Using  Application.FileDialog(msoFileDialogSaveAs)
> seems to work nicely, but I am a bit concerned that this may not be a
> good long-term approach. >> >> When doing research about this method,
> I stumbled upon this statement on a Microsoft web page. >> >> "
> msoFileDialogSaveAs constants are not supported in Microsoft Office
> Access 2007" >> >> This, and other comments that I have read have made
> me wonder if I am heading down the wrong path. (no pun intended) >> >>
> Is Application.FileDialog(msoFileDialogSaveAs) a viable approach? >>
> >> Is there a better way to give the end-users an easy way to change
> the name (and folder) of the generated Excel file? >> >> Thanks, >>
> Brad >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com
> >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website:
> http://www.databaseadvisors.com >> >> > > -- > AccessD mailing list >
> AccessD at databaseadvisors.com >
> http://databaseadvisors.com/mailman/listinfo/accessd > Website:
> http://www.databaseadvisors.com > > -- > This message has been scanned
> for viruses and > dangerous content by MailScanner, and is > believed
> to be clean. > > > -- > AccessD mailing list >
> AccessD at databaseadvisors.com >
> http://databaseadvisors.com/mailman/listinfo/accessd > Website:
> http://www.databaseadvisors.com >
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 







More information about the AccessD mailing list