Push data from current record in form into a new Excel file, using Excel template (1 Viewer)

KKilfoil

Registered User.
Local time
Today, 14:51
Joined
Jul 19, 2001
Messages
336
I searched the archive and didn't find quite what I was looking for, so..

I have an Excel 2003 spreadsheet work-in-progress being used as a template (developed by others) to prepare project cost estimates in a complex regulatory environment. We are 'modelling on the fly' for a number of projects until we are comfortable with the estimate model, after which time I intend to incorporate our 'stable' estimate methodology into Access. Meanwhile, I am 'stuck' with the Excel spreadsheet.

I have a project tracking database (Access 2003), and I want to be able to track my estimates. I do NOT want to embed my spreadsheets into the db, just a filelink. There can be more than 1 estimate per project.

Ideally, the user should be able to define a project in the Access db (or select one already defined) and click a 'make estimate' button, which would generate a new Excel file in a predefined directory (based on the present version of the .xlt file), give it an appropriate filename (based on the Access ProjectID and estimate sequence number for that project if there were others already), open up that workbook in Excel, and then autopopulate some cells based on information showing on the original form in Access!

A separate button for 'Open existing estimate' will eventually be required, but I think I could do that if I can get someone to walk me through the steps required above.

I am somewhat familiar with vba in Access, but am an absolute rookie when it comes to excel.

Edit: I left out that I would also add an appropriate record to a table like tblEstimate which would contain the link(s) to the estimate(s). This table will obviously contain a FK to tblProject
 
Last edited:

KKilfoil

Registered User.
Local time
Today, 14:51
Joined
Jul 19, 2001
Messages
336
OK, I figured a bit out on my own.

I am using .GetObject to open the existing XL file, and then a SaveAs to make a copy of it.

When I open the new XL file by normal means, everything is OK.

However, when I open the same file via another GetObject call, the worksheet is hidden, which I can Unhide via the menu.

1) How do I open the Excel file from within Access and have the worksheet be not hidden?

2) How do I fill in specific cells with data from the active record on my open Access form? Assume I have given all such Excel cells rangenames such as 'Project_Description'
 

Users who are viewing this thread

Top Bottom