VB and an Excel Spreadsheet
I'm writing a program in VB6 that accesses an Excel spreadsheet for storing,
manipulating and printing out data. Here's what's happening:
First, consider the following code, as copied from a recorded Excel macro:
I recorded that macro in an effort to troubleshoot the following from the
This code WORKS. . .
. . . IF I have the spreadsheet open at the same time, the code runs without
error. HOWEVER, if the spreadsheet is closed (and mind you, everything else
STILL works okay), I get the following:
Runtime Error '1004':
Select method of Range class failed.
Selecting "Debug" highlights the third line (LastSheet.Range("A1").Select)
as containing the offending code.
I'd greatly appreciate ANY help.