By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,695 Members | 1,580 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,695 IT Pros & Developers. It's quick & easy.

File DialogBox to Import Spreadsheet

P: 7

I need the exact same thing that is..import excel sheets to access but having the option of browsing for the excel sheet i want to import.

I tried out the code you have mentioned above and it is showing a compilation error at Me.tb_FileName = strFilePath.

It highlights .tb_FileName and says "Method or Data member not found"

Do I need to give reference library for this command? Or do I need to change something of text box on the form which is supposed to display the file path?

Please help me out

** Edit **
This thread was originally posted into Use a button to open a File dialog box to import a Excel spreadsheet
Jul 13 '10 #1
Share this Question
Share on Google+
9 Replies

Expert 100+
P: 1,240
You mean to use Me! instead of Me.
Expand|Select|Wrap|Line Numbers
  1. Me!tb_FileName = strFilePath
Jul 13 '10 #2

P: 7
Hi Jim,

I tried to replace Me. with Me! but now it says 'invalid use of the keyword Me' while compilation
Jul 13 '10 #3

Expert Mod 15k+
P: 31,769
Do you actually have a control called [tb_FileName] on your form?

By the way, either Me. or Me! works fine. There are discussions as to which is recommended and for what reasons, but they are entirely irrelevant in this instance.
Jul 13 '10 #4

P: 7
Yes..I have a text box I named tb_FileName Still it shows compilation error: Invalid use of Keyword Me
Jul 14 '10 #5

Expert Mod 100+
P: 2,321
Have you added the code to a module that is bound to a form, or to a independent module?

The invalid reference to me. sounds as if you have tried to put the code in a seperate module.
Jul 14 '10 #6

P: 7
That was it! I had put the code in a separate module..Sorry I am a complete beginner.
Thanks a lot!! Its working out just fine now :)
Jul 14 '10 #7

Expert Mod 100+
P: 2,321
We all start somewhere. Glad to be of assistance!
Jul 14 '10 #8

Expert Mod 15k+
P: 31,769
No need to apologise.

These things seem obvious to us, but only because of the experience we already have. Without that, we wouldn't have the understanding of such Office-specific concepts. Scope is an issue that has caused people to struggle for many years.
Jul 14 '10 #9

P: 7
Its amazing how you guys figure out stuff without actually having a look at it.
Respekt! And Thanks once again
Jul 14 '10 #10

Post your reply

Sign in to post your reply or Sign up for a free account.