Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an Excel macro from within Access VBA

Status
Not open for further replies.

smgeorge99

Programmer
Jun 6, 2003
21
US
I have an Access database that creates Excel spreadsheets using VBA code. The spreadsheets are sent out to various people who add/update the data in the spreadsheet. The spreadsheets are then uploaded into the database using VBA code within Access.

A new requirement has come up where when a user edits a particular cell in the generated spreadsheet, a dialog box pops up that prompts the user to add more info, which is then appended to another cell.

I'm thinking that I need a some sort of Excel macro to do this. Can I create an Excel macro in Access VBA when generating the spreadsheet?

Thanks in advance,

Sean
 
Create a workbook template that contains all your macros and formatting and base your new workbooks on the template.

Code:
Sub OpenExcelUsingTemplate()
  Dim xl As New Excel.Application
  Dim wb As New Excel.Workbook
  
  Set xl = New Excel.Application
  Set wb = xl.Workbooks.Add("C:\MyCustomTemplate.xlt")
  
  xl.Visible = True
  
End Sub


VBSlammer
redinvader3walking.gif

[sleeping]Unemployed in Houston, Texas
 
I'd thought of that. Is there a way to do it without having to use a template?
 
It has been done (and shown) in these fora. See Thread705-360039 for at least one example. Others do EXIST, some of which are clearer (easier to read).





MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top