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

FindFirst method not working when looking at file path and file name

P: 4
I'm using 2002

I defined my recordset as rWrkSheet
Spreadsheet is the field in table Spreadsheets
PathToExcelFiles is the full path where the Excel files i'm ref is stored
ExcelFileName is the actual file name of the Excel file

rWrkSheet.FindFirst "Spreadsheet = """ &PathToExcelFiles + ExcelFileName """"

I think my syntax is wrong, keeps coming back as an unsupported object. What I'm trying to do is if the value in the field Spreadsheet is not equal to the name of the excel file located at the end of the path then it moves on to what I need it do to next. Unfortunately it doesn't move on. Any ideas?
Oct 25 '07 #1
Share this Question
Share on Google+
1 Reply


nico5038
Expert 2.5K+
P: 3,072
I'm using 2002

I defined my recordset as rWrkSheet
Spreadsheet is the field in table Spreadsheets
PathToExcelFiles is the full path where the Excel files i'm ref is stored
ExcelFileName is the actual file name of the Excel file

rWrkSheet.FindFirst "Spreadsheet = """ &PathToExcelFiles + ExcelFileName """"

I think my syntax is wrong, keeps coming back as an unsupported object. What I'm trying to do is if the value in the field Spreadsheet is not equal to the name of the excel file located at the end of the path then it moves on to what I need it do to next. Unfortunately it doesn't move on. Any ideas?
Try:
Expand|Select|Wrap|Line Numbers
  1. rWrkSheet.FindFirst "Spreadsheet = '" & PathToExcelFiles & ExcelFileName & "'"
  2.  
and make sure that theres a trainling "\" in the PathToExcelFiles !

Nic;o)
Oct 25 '07 #2

Post your reply

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