Skip to main content
Cadet | Tier 2
April 12, 2023
Question

SQL From statement as a variable

  • April 12, 2023
  • 2 replies
  • 342 views

Hello Everyone 

Usually the statement is like: Select * from [sheet1$$] where  etc etc

I need the sheet1 to be a variable, the sheet changes with each excell book I bring in and there are lots

I tried [$SheetNameHere$] that did not work, even when I remove the square brackets.

    2 replies

    rbkadiyam
    Premier Pathfinder | Tier 7
    Premier Pathfinder | Tier 7
    April 12, 2023

    @The Automator  what error you are getting ?

    Ramesh B Kadiyam
    Cadet | Tier 2
    April 12, 2023

    The Microsoft Access database engine could not find the object - after the word object in single quotes was the value of the variable then it goes on to say make sure the object exists.

    The name it mentions is the correct sheet name, it does successfully open the spreadsheet.