1 Replies - 1027 Views - Last Post: 10 February 2008 - 03:55 PM Rate Topic: -----

#1 rupalamin  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-February 08

Trying to open a macro in excel by clicking a command in access

Posted 10 February 2008 - 02:20 PM

Public Function OpenExcelLN()
DoCmd.SetWarnings False
	
	  Dim strMsg As String
	
	strMsg = "WARNING!!!  ONLY RUN ONCE EACH PROCESS! Cancel if already updated!"
	
	If MsgBox(strMsg, vbOKCancel, "Update_LN_Comparison") = vbOK Then
	
	   
  
	Dim xl As Excel.Workbook
	
	Set xl = GetObject("S:\Performance_Variance\Update_Performance_Variance_Report.xls", "Excel.Sheet")
	' Make Excel Visible.
	xl.Application.Visible = True
	'Make the Workbook visible.
	xl.Application.Windows("Update_Performance_Variance.xls").Visible = True
	xl.Application.Run "Update_Comparison"
	xl.Application.Quit	 ' Close Excel.
  DoCmd.SetWarnings True
	
	End If
   
End Function



EDIT: Please use code tags when posting your code, it makes it much easier to read :) Code tags are used like :code:

This post has been edited by PsychoCoder: 10 February 2008 - 03:54 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Trying to open a macro in excel by clicking a command in access

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Trying to open a macro in excel by clicking a command in access

Posted 10 February 2008 - 03:55 PM

What about this code isn't working? Are you getting an error, if so what exactly is the error message? If this code isn't doing what you need it to do, what is it doing. These are vital pieces of information needed so we can better help you :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1