Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Linked file Excel 2007

Hello,

We have an application that keeps track of weekly transactions, and is
linked to a summary workbook. At the end of the week, a procedure is
run (from the weekly file) that saves the weekly file under a new
name, and adds new links to the summary file.

This application ran without a hitch for over a year, until the client
updated to Excel 2007. Now we're frequently experiencing the "Excel
has experienced a problem and needs to close, etc" message. I've been
able to reproduce the problem with the following bit of code.

Create 2 workbooks, "week_01.xlsm" & "summary.xlsx". From the summary
workbook, create a link to the weekly file. Add the code to the
weekly workbook. The 1st run proceeds without a problem, but the 2nd
run crashes while trying to open "summary.xlsx"

Strangely enough, it runs OK from the VBE. Also runs OK if the
summary is changed to an "xls" file. After making the appropriate
changes, it also runs without trouble in Excel 97. I know I'm
probably missing something quite basic, but I've been working on this
for a few days, and this is as far as I've got. Any insight into this
would be most appreciated.

Regards,

Dave


Sub WeeklyRollOver()

Dim x As Integer, str As String
Dim fName As String
Dim Wb As Workbook

Set Wb = ThisWorkbook
ChDir Wb.Path

'generate new week file name
str = Wb.Name
x = CInt(Mid(str, 6, 2)) + 1
str = Format(x, "00")
fName = "week_" & str & ".xlsm"

'Save with new name
Wb.SaveAs Filename:=fName, FileFormat:=52

'open summary file

fName = "summary.xlsx"
Workbooks.Open fName, updatelinks:=0

ActiveWorkbook.Close savechanges:=False

Set Wb = Nothing

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Linked file Excel 2007

Hello,

I believe I've found what's causing our problem, hopefully this may
help someone else experiencing something similar.

I was running the procedure from a Form button on the worksheet -
changed it to an Active-X button, and now everything works fine -
repeated testing appears to confirm the 'fix'. However, although it's
a non-issue in our situation, it still fails if run from the Ribbon
(Developer Macros Macro name) - which makes me slightly uneasy.

Perhaps someone can offer an explanation for this.

Regards,

Dave
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked spreadsheets failing to recognised that the linked file is Michael Excel Discussion (Misc queries) 0 January 14th 10 12:03 PM
Excel 2007 Crash Due to Linked File Huijie Excel Discussion (Misc queries) 0 July 13th 09 01:21 PM
Linked Charts in Word/Excel 2007 gb0dms Links and Linking in Excel 5 April 2nd 09 12:09 PM
Displaying linked data in excel 2007 when linked file is not avail Eng_19 Excel Discussion (Misc queries) 0 December 7th 07 07:27 PM
Problems with my links to an excel 2007 file from a word 2007 file sc Links and Linking in Excel 0 February 21st 07 10:12 AM


All times are GMT +1. The time now is 01:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"