I have been trying to prompt a user for a file name. I'm using the code below but keep getting the message "compile error: Method or data member not found". It is stopping on the Application.Fil eDialog line. Any help would be greatly appreciated!! - Private Sub Command13_Click()
-
-
Dim myDialog As FileDialog
-
Dim strFile As String
-
Dim strSearchPath As String
-
Dim vrtSelectedItem As Variant
-
Set myDialog = Application.FileDialog(msoFolderPicker)
-
'Use strSearchPath if you want to start in a particular directory. You can leave it out if you wish (as I have it commented out right now) and it will start with a default directory of Windows choosing.
-
'strSearchPath ="C:\SomeDirectory\SomeSubDirectory"
-
With myDialog
-
.AllowMultiSelect = True
-
.Filters.Add "Excel Files", "*.xls", 1
-
.Title = "Please Locate the Files to Import!"
-
.InitialFileName = strSearchPath
-
If .Show = -1 Then
-
-
For Each vrtSelectedItem In .SelectedItems
-
'I pass the file information to another routine that handles the transfer
-
ImportIt (vrtSelectedItem)
-
Next vrtSelectedItem
-
MsgBox "All data imported into the NewData Table." & vbCrLf & vbCrLf & "We will now post any new data into the data table!"
-
Else
-
'The user pressed Cancel.
-
End If
-
Set myDialog = Nothing
-
End With
-
-
End Sub
7 4627 NeoPa 32,579
Recognized Expert Moderator MVP
Try using (msoFileDialogF olderPicker) on your line number 7. - Set myDialog = Application.FileDialog(msoFileDialogFolderPicker)
NeoPa 32,579
Recognized Expert Moderator MVP
Try using (msoFileDialogF olderPicker) on your line number 7. - Set myDialog = Application.FileDialog(msoFileDialogFolderPicker)
I got that from the help, but when I went to Debug.Print it there was nothing.
Confused, I found that the Reference to Office ( Microsoft Office 11.0 Object Library or version equivalent) is required to use it. Make sure you have such a reference in your Access set up, and make sure it is also available for all computers that expect to run your project.
Good luck.
That helped. Thanks! BUT, now I get a "run time error" '438'. It says the object doesn't support this property or method. It is stopping on the Filters.Add line. Any ideas? Thanks a lot for your help.
Actually my code passed through the error and got to "ImportIt" and says the sub or function not defined. Any help on this one rather than the one I just posted? Thanks!
NeoPa 32,579
Recognized Expert Moderator MVP
Actually my code passed through the error and got to "ImportIt" and says the sub or function not defined. Any help on this one rather than the one I just posted? Thanks!
As far as I can see there's no procedure ImportIt defined.
Please use the line numbers in future when referring to your code. It makes life a bit easier.
Thanks so much for your help! I believe I can get beyond this now. Have a good day.
NeoPa 32,579
Recognized Expert Moderator MVP
No problem.
Good luck with you project :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Gord |
last post by:
Hello,
If you set the flag for an overwrite prompt using the 'Save' common dialog,
how do you read the response when the user clicks the Yes or No in the
'overwrite' message box?
Everything I've read explains about setting the flag to bring up the
overwrite prompt message box, but there's no explanation on how to read the
response to it. It appears that clicking the Yes option doesn't actually
overwrite the old file, so I assume I'm...
|
by: Paul Deverson |
last post by:
I'm a newbie to MySQL and am really confused about when I should be using
the Command Line Client and when the DOS prompt.
I'm using Windows XP and I've just installed MySQL 4.1.10.
I can use the Command Line Client to logon as 'root'. It prompts me for a
password and then I can create databases, etc. from the mysql prompt.
However, if I wanted to logon as a different user, I'm not sure how to do
it.
|
by: Chris Powell |
last post by:
I am using Excel/Access 2000 and have two large Excel files (25,000 rows
each) that I wish to create linked tables in Access rather than
importing into Access. The two source Excel files change frequently, so
I want to:
A) prompt the user, using a custom form, for the specific Excel files to
be linked;
B) create the links dynamically;
C) insert the linked tables into a select query grid and include the SQL
statement in the VBA...
|
by: Tom van Stiphout |
last post by:
We secured an Access MDB for a client, using the Access 2000 (or above -
still trying to find that out) security wizard. I trust the developer who
did this, and the screendumps of the process don't give any indication he
missed a step, or got an error, etc.
On several machines in our office, if you try to open the database without
the special system.mdw, you correctly get an error "You do not have the
necessary permissions...". With that...
|
by: jodyblau |
last post by:
I applogize for posting this a second time (I posted in the
access-multiuser group as well), but this group seems to respond more
rapidly, and I have been trying to figure this out for what seems like
forever.
I have the Access 2002 Developer's Handbook, and I am trying to learn
from the example provided in Chapter 2, but I am running into the
following problem.
I set an admin password and a username and password on the backend,
| |
by: melickas |
last post by:
We designed a custom application using Office Developer Tools '97 which
included a Run-time version of Access--- so it would not matter if our
customer even had any version of Access on their computer. The
application ran without problems on our customer's computer for 2-3
years. Then our customer bought a new computer and we had to reinstall
the application. Everything was ok for approximately 6 months until our
customer was "cleaning up"...
|
by: kmarchiony |
last post by:
Hi anyone!
I am working to translate an Excel macro into Access and I'm having little luck with a couple lines of code. I can't figure out how to prompt the user to select a file (not to past a path and filename) but to actually browse for a file :) Here is the Excel code I already have:
Dim TxtName As String
TxtName = Application.GetOpenFilename("TextFiles (*.txt), *.txt", , "Select The file you wish to update:")
I'm also hoping to...
|
by: ARC |
last post by:
Hello all,
I didn't use to have this problem in Access 97, but in 2007 (and maybe other
versions of access after 97), if you have a form that has a subform, and you
click the close button, you always get the following dialog:
"Save changes to the following objects?"
I tried putting a saverecord command prior to the close, but that had no
affect. I have found a work around, but maybe I am making this too
|
by: =?Utf-8?B?TW9uaXF1ZQ==?= |
last post by:
I just reinstalled IIS as I worked with wamp before and yet I didn't find out
how to have a php and a asp server working the same time on a computer. (I
had to uninstall the IIS to get wamp at work). But my question now is only
about asp. Everything works in asp only that there comes a popup that ask
for username and password. I searched what could be meant and saw you use
the terminology "IUSR_COMUTERNAME and IWAM_COMPUTERNAME".
I...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |