C
cmw
I have an application which currently opens an instance of
MSWord and generates a letter using a predefined template.
[code includes: dim WordObj as Word.Application, Set
WordObj = CreateObject("Word.Application"),
WordObj.Documents.Add Template:= (template name &
location)]. Works just fine - creates the letter, allows
user to modify and save if necessary.
I now need to open a blank excel spreadsheet, prefill some
data and allow the user to take control. The data will be
dynamic, the result of queries, calculations and lookups.
It will be derrived from different tables, fields, etc.
Following the same methodology as with word, I can open
Excel by declaring an ExcelObj as Excel.Application, Set
ExcelObj = CreateObject("Excel.Application") but then am
stuck. Excel is opened but it does not have an open
spreadsheet, just the application itself. I've tried
everything I can think of to open a spreadsheet.
In MSAccess help, it suggests linking to an existing Excel
spreadsheet, manually copying and pasting the result of a
query, etc, or using the Shell command. In Excel help, it
refers to a switch "Ignore other applications". When I
open excel normally, that setting is just fine. When
opened from setting the object in Access, I can't see the
setting as the menu is disabled.
I can shell to Excel, but thought I read somewhere that
that isn't the best way to interface.
Any suggestions???
Thanks,
cmw
MSWord and generates a letter using a predefined template.
[code includes: dim WordObj as Word.Application, Set
WordObj = CreateObject("Word.Application"),
WordObj.Documents.Add Template:= (template name &
location)]. Works just fine - creates the letter, allows
user to modify and save if necessary.
I now need to open a blank excel spreadsheet, prefill some
data and allow the user to take control. The data will be
dynamic, the result of queries, calculations and lookups.
It will be derrived from different tables, fields, etc.
Following the same methodology as with word, I can open
Excel by declaring an ExcelObj as Excel.Application, Set
ExcelObj = CreateObject("Excel.Application") but then am
stuck. Excel is opened but it does not have an open
spreadsheet, just the application itself. I've tried
everything I can think of to open a spreadsheet.
In MSAccess help, it suggests linking to an existing Excel
spreadsheet, manually copying and pasting the result of a
query, etc, or using the Shell command. In Excel help, it
refers to a switch "Ignore other applications". When I
open excel normally, that setting is just fine. When
opened from setting the object in Access, I can't see the
setting as the menu is disabled.
I can shell to Excel, but thought I read somewhere that
that isn't the best way to interface.
Any suggestions???
Thanks,
cmw