Hello,
I am trying to extract reads at 1 base pair from many bam files.  Each bam file has a bai file with the same name+.bai in the same folder.

When I run

    samtools view myfile.bam

I get the output, but when I add coordinates such as

    samtools view myfile.bam "chr1:1-100000"

I get the following error: 

    [bam_index_load] fail to load BAM index.
    [main_samview] random alignment retrieval only works for indexed BAM files.

My understanding is that the bai file is the index it needs.  Am I missing something?

Thanks in advance.
Some things to consider:

1. Your index may old or  generated with a program other than samtools. You might want to regenerate it. 
2. Make sure the BAM itself is sorted by coordinate. Also make sure that the names are correct between the two files, i.e., you didn't change the name of the BAM after indexing or something.
3. The index itself also needs to be accessible and readable by samtools.