ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Has my macro broken Excel? (https://www.excelbanter.com/excel-programming/315205-has-my-macro-broken-excel.html)

Alan[_27_]

Has my macro broken Excel?
 
All

I've started writing VBA macros. I have however, upset Excel. When I
click on an Excel spreadsheet file in a folder, Excel opens as an
application, but the associated file does not open. If I go into Excel
and open the file from there, all is OK.

The only bit of VBA I can see which may have done this is:

Windows("myfile.xls").Activate
Application.DisplayAlerts = False
ActiveWorkbook.Close SaveChanges:=False
Application.DisplayAlerts = True

This may or may not be the reason. I'd appreciate any comments or
suggestions.

Regards

Alan

Frank Kabel

Has my macro broken Excel?
 
Hi
in Excel goto 'Tools - Options - General' and uncheck 'Ignore other
applications'

"Alan" wrote:

All

I've started writing VBA macros. I have however, upset Excel. When I
click on an Excel spreadsheet file in a folder, Excel opens as an
application, but the associated file does not open. If I go into Excel
and open the file from there, all is OK.

The only bit of VBA I can see which may have done this is:

Windows("myfile.xls").Activate
Application.DisplayAlerts = False
ActiveWorkbook.Close SaveChanges:=False
Application.DisplayAlerts = True

This may or may not be the reason. I'd appreciate any comments or
suggestions.

Regards

Alan


Tom Ogilvy

Has my macro broken Excel?
 
go to tools=Options and then the general tab. If Ignore Other
Applications is checked, then uncheck it.

If that doesn't fix the problem (or is not the problem)

close excel.

Go to the Windows Start menu and select Run

in the textbox enter

Excel.exe /regserver

Click the OK button


--
Regards,
Tom Ogilvy


"Alan" wrote in message
om...
All

I've started writing VBA macros. I have however, upset Excel. When I
click on an Excel spreadsheet file in a folder, Excel opens as an
application, but the associated file does not open. If I go into Excel
and open the file from there, all is OK.

The only bit of VBA I can see which may have done this is:

Windows("myfile.xls").Activate
Application.DisplayAlerts = False
ActiveWorkbook.Close SaveChanges:=False
Application.DisplayAlerts = True

This may or may not be the reason. I'd appreciate any comments or
suggestions.

Regards

Alan




Simon Lloyd[_599_]

Has my macro broken Excel?
 

This may sound daft but have you tried right clicking an Excel fil
choose open with (if this doesnt appear click off the file then laf
click once hold down the shift key and then right click once open wit
should now be available) click on the excel icon once and then clic
the check box "Always the selected program to open this file type".

A shot in the dark but that may be your problem!

HTH

Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=27359



All times are GMT +1. The time now is 10:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com