Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Workbook_Open command fails and blows up all cell formulas

Good morning --
On opening, my workbook runs a sub called 'Reflinks' (listed below) that
opens a file on a company server and downloads a lot of reference values.
About 20 managers have copies of the workbook in offices across the
northwest, and they all open up and retrieve this reference data. The
workbook consists of two data pages, three calculation pages, and one final
'presentation' page. There are lots of references between the pages, as well
as to pull the reference data from our server.
One of the managers opened up her workbook, and got an error code 1004 --
'the specified dimension is not valid for the current chart type'. Then,
EVERY cell on EVERY page that had a reference to another page got changed to
look for the data from the server, rather than the correct page in the
workbook. So, if the formula said "='Page1'!A1", it was automatically
changed to 'ftp://[Instrument Panel Reference Data]'Page1'!A1"! For hundreds
of cells. And all the calculation cells on all pages are password-protected,
but it still happened anyway. Here's the code:

Sub RefLinks()
Dim wkb As String

'Refresh Links
Sheets("Other Calculations").Select
ActiveSheet.Unprotect ("MedMan")
wkb = ActiveWorkbook.Name

' ActiveWorkbook.ChangeLink Name:= _
' /Peter/Instrument Panel
Reference Data.xls" _
' , NewName:="Instrument Panel Reference Data.xls", Type:=xlExcelLinks
ActiveWorkbook.ChangeLink Name:="Instrument Panel Reference Data.xls", _
NewName:="Instrument Panel Reference Data.xls", Type:=xlExcelLinks
Workbooks.Open Filename:= _
"ftp://mariantoo.medman.com/Peter/Instrument Panel Reference Data.xls"
Windows(wkb).Activate


ActiveSheet.Protect ("MedMan"), DrawingObjects:=True,
Contents:=True, Scenarios:=True
End Sub

Thanks in advance for any help you can provide. I don't relish fixing 100+
cells, especially if I don't know why it blew up in the first place.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Workbook_Open command fails and blows up all cell formulas

It seems to me that if all other workbooks are functioning as designed, that
the one which does not function properly has a different condition than the
others. If that is true, then that system would require individual analysis
to determine what is different to cause the cells to reference the ftp link
as part of the workbook reference. Apparently the basic code works.

"pdberger" wrote:

Good morning --
On opening, my workbook runs a sub called 'Reflinks' (listed below) that
opens a file on a company server and downloads a lot of reference values.
About 20 managers have copies of the workbook in offices across the
northwest, and they all open up and retrieve this reference data. The
workbook consists of two data pages, three calculation pages, and one final
'presentation' page. There are lots of references between the pages, as well
as to pull the reference data from our server.
One of the managers opened up her workbook, and got an error code 1004 --
'the specified dimension is not valid for the current chart type'. Then,
EVERY cell on EVERY page that had a reference to another page got changed to
look for the data from the server, rather than the correct page in the
workbook. So, if the formula said "='Page1'!A1", it was automatically
changed to 'ftp://[Instrument Panel Reference Data]'Page1'!A1"! For hundreds
of cells. And all the calculation cells on all pages are password-protected,
but it still happened anyway. Here's the code:

Sub RefLinks()
Dim wkb As String

'Refresh Links
Sheets("Other Calculations").Select
ActiveSheet.Unprotect ("MedMan")
wkb = ActiveWorkbook.Name

' ActiveWorkbook.ChangeLink Name:= _
' /Peter/Instrument Panel
Reference Data.xls" _
' , NewName:="Instrument Panel Reference Data.xls", Type:=xlExcelLinks
ActiveWorkbook.ChangeLink Name:="Instrument Panel Reference Data.xls", _
NewName:="Instrument Panel Reference Data.xls", Type:=xlExcelLinks
Workbooks.Open Filename:= _
"ftp://mariantoo.medman.com/Peter/Instrument Panel Reference Data.xls"
Windows(wkb).Activate


ActiveSheet.Protect ("MedMan"), DrawingObjects:=True,
Contents:=True, Scenarios:=True
End Sub

Thanks in advance for any help you can provide. I don't relish fixing 100+
cells, especially if I don't know why it blew up in the first place.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Workbook_Open command fails and blows up all cell formulas

Thanks for the prompt response. Unfortunately, she's in Alaska so I can't
just wander over. Things worked fine until, for no reason that we can
figure, it just blew up and rewrote everything. So perhaps two questions:

1) Is there some way I can protect the sheets, cells, and graphs so that
the only possible way to change them is manually?
2) In looking for something different in her setup, is there any place we
can start first?

Thanks in advance.

"JLGWhiz" wrote:

It seems to me that if all other workbooks are functioning as designed, that
the one which does not function properly has a different condition than the
others. If that is true, then that system would require individual analysis
to determine what is different to cause the cells to reference the ftp link
as part of the workbook reference. Apparently the basic code works.

"pdberger" wrote:

Good morning --
On opening, my workbook runs a sub called 'Reflinks' (listed below) that
opens a file on a company server and downloads a lot of reference values.
About 20 managers have copies of the workbook in offices across the
northwest, and they all open up and retrieve this reference data. The
workbook consists of two data pages, three calculation pages, and one final
'presentation' page. There are lots of references between the pages, as well
as to pull the reference data from our server.
One of the managers opened up her workbook, and got an error code 1004 --
'the specified dimension is not valid for the current chart type'. Then,
EVERY cell on EVERY page that had a reference to another page got changed to
look for the data from the server, rather than the correct page in the
workbook. So, if the formula said "='Page1'!A1", it was automatically
changed to 'ftp://[Instrument Panel Reference Data]'Page1'!A1"! For hundreds
of cells. And all the calculation cells on all pages are password-protected,
but it still happened anyway. Here's the code:

Sub RefLinks()
Dim wkb As String

'Refresh Links
Sheets("Other Calculations").Select
ActiveSheet.Unprotect ("MedMan")
wkb = ActiveWorkbook.Name

' ActiveWorkbook.ChangeLink Name:= _
' /Peter/Instrument Panel
Reference Data.xls" _
' , NewName:="Instrument Panel Reference Data.xls", Type:=xlExcelLinks
ActiveWorkbook.ChangeLink Name:="Instrument Panel Reference Data.xls", _
NewName:="Instrument Panel Reference Data.xls", Type:=xlExcelLinks
Workbooks.Open Filename:= _
"ftp://mariantoo.medman.com/Peter/Instrument Panel Reference Data.xls"
Windows(wkb).Activate


ActiveSheet.Protect ("MedMan"), DrawingObjects:=True,
Contents:=True, Scenarios:=True
End Sub

Thanks in advance for any help you can provide. I don't relish fixing 100+
cells, especially if I don't know why it blew up in the first place.

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
Shell Command Fails (sometimes) Daniel Excel Programming 4 January 20th 08 11:18 PM
Workbook_Open event fails to fire XP Excel Programming 3 October 31st 07 10:53 PM
Workbook_open event disabled by manual calc command Twotone Excel Programming 3 March 12th 07 07:46 PM
Excel 97 fails to execute Workbook_Open() on New XLS from Template (FYI) [email protected] Excel Programming 1 March 3rd 07 11:39 AM
ADO Open command fails on multiple SQL functions Zachary Bass Excel Programming 1 August 12th 03 07:54 PM


All times are GMT +1. The time now is 05:13 PM.

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

About Us

"It's about Microsoft Excel"