You need to add a reference to Excel. Go to Tools/References (from the VBA
window). Scroll down to Microsoft Excel and check the box. I am using
E2003. I don't know if this code would need to be different in other
versions.
"I'm assuming that you mean via automation since the
TransferSpreadsheet
method only works with a specific spreadsheet. "
I didn't (and don't) understand what you meant by "via automation" but
seems like I better find out since now I'm getting a "Automation Error
- The server threw an exception"
What exactly do you want to do with spreadsheet once you have it open? The
code I gave you allows you to open the spreadsheet (usually you would set
visible to false because your code will perform the modifications rather
than the user) and manipulate it with code. You can do things like place
values in particular cells or set formatting. Basically, anything you can
do with the Excel GUI, you can do programmatically once you figure out the
correct objects, methods, and properties.
Basically I would be inserting data in cells and some of the other
cells would do calculations based on the initial input. Though the
hope was that the button would basically be a hyperlink to excel, a
quick shortcut from the program to enter the next set of data in the
daily routine rather then going to look for it.
Thanks for all the help thus far
Adien
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.