Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default workbook used to open but now crash with File/path error

office excell 2003
windows xp

i been working on a .xls sheet with 3 userforms and about 8 usermodules.

to start i got

///////////////////////////////////////////////////////////////////////////////////////////////
Private Sub Workbook_Open()
Sheets("Sheet1").Select
Worksheets("sheet1").Range("K4").Value = False
Worksheets("sheet1").Range("K5").Value = False
Worksheets("sheet1").Range("K6").Value = False
Worksheets("sheet1").Range("K7").Value = False
Worksheets("sheet1").Range("K8").Value = False


With Application
.Calculation = xlCalculationAutomatic
.MaxChange = 0.001
End With

Application.Visible = False



UserForm1.Show

UserForm1.TextBox1.Value = ""
UserForm1.CheckBox1.Value = False
UserForm1.CheckBox2.Value = False
UserForm1.CheckBox3.Value = False
UserForm1.CheckBox4.Value = False
UserForm1.CheckBox5.Value = False


End Su
///////////////////////////////////////////////////////////////////////////////////////////////

when i select disable macro's the workbook dont crash but if i enable it
does....


///////////////////////////////////////////////////////////////////////////////////////////////
file/path access erro
///////////////////////////////////////////////////////////////////////////////////////////////

and when i go and look at the repair log i get

////////////////////////////////////////////////////////////////////////////////////////////////
Microsoft Office Excel File Repair Log

Errors were detected in file 'C:\files\Jobcard.xls'
The following is a list of repairs:

Lost Visual Basic project
///////////////////////////////////////////////////////////////////////////////////////////////
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default workbook used to open but now crash with File/path error

i did allready

export all userform and modules

copy sheets to new workbook
copy paste workbook_open and workbook_close

save with diffrent name

import userforms and modules.

still crash
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default workbook used to open but now crash with File/path error

Is there another part of your macro(s) that refer to your file name or path
and file name specifically? Has any of that information changed?

The only thing I can see from what you have posted that may have a conflict
is your sheet reference.

Should " Worksheets("sheet1").Range("K4").Value = False " be "
Worksheets("Sheet1").Range("K4").Value = False " ?


Can you post any of your other code? Specifically the portion of it that
crashes.



Mark Ivey


"pswanie" wrote in message
...
office excell 2003
windows xp

i been working on a .xls sheet with 3 userforms and about 8 usermodules.

to start i got

///////////////////////////////////////////////////////////////////////////////////////////////
Private Sub Workbook_Open()
Sheets("Sheet1").Select
Worksheets("sheet1").Range("K4").Value = False
Worksheets("sheet1").Range("K5").Value = False
Worksheets("sheet1").Range("K6").Value = False
Worksheets("sheet1").Range("K7").Value = False
Worksheets("sheet1").Range("K8").Value = False


With Application
.Calculation = xlCalculationAutomatic
.MaxChange = 0.001
End With

Application.Visible = False



UserForm1.Show

UserForm1.TextBox1.Value = ""
UserForm1.CheckBox1.Value = False
UserForm1.CheckBox2.Value = False
UserForm1.CheckBox3.Value = False
UserForm1.CheckBox4.Value = False
UserForm1.CheckBox5.Value = False


End Sub
///////////////////////////////////////////////////////////////////////////////////////////////

when i select disable macro's the workbook dont crash but if i enable it
does....


///////////////////////////////////////////////////////////////////////////////////////////////
file/path access error
///////////////////////////////////////////////////////////////////////////////////////////////

and when i go and look at the repair log i get

////////////////////////////////////////////////////////////////////////////////////////////////
Microsoft Office Excel File Repair Log

Errors were detected in file 'C:\files\Jobcard.xls'
The following is a list of repairs:

Lost Visual Basic project.
///////////////////////////////////////////////////////////////////////////////////////////////


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default workbook used to open but now crash with File/path error

got it narrowed down to when ever i point/go to userform1

this is what i got in userfrom1


'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''



Private Sub CommandButton4_Click()
Application.Visible = True

Unload UserForm1
Sheets("Sheet1").Select
ActiveWorkbook.Save
Application.Quit
End Sub


Private Sub CommandButton5_Click()
Unload UserForm1
UserForm1.Show
End Sub


Private Sub UserForm_activate()

'UserForm1.TextBox1.Value = ""
'UserForm1.CheckBox1.Value = False
'UserForm1.CheckBox2.Value = False
'UserForm1.CheckBox3.Value = False
'UserForm1.CheckBox4.Value = False
'UserForm1.CheckBox5.Value = False

End Sub

Private Sub UserForm_Initialize()

Me.TextBox1.Value = ""
Me.CheckBox1.Value = False
Me.CheckBox2.Value = False
Me.CheckBox3.Value = False
Me.CheckBox4.Value = False
Me.CheckBox5.Value = False
Call check4internet

End Sub

'prevent user clicking red "x"
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
End If
End Sub





Private Sub CommandButton1_Click()

If TextBox1 = "" Then
MsgBox "Please enter a description"
Else

Sheet1.Range("E1").Select
ActiveCell.FormulaR1C1 = "=username()"



If Worksheets("sheet1").Range("H30").Value = True Then


MsgBox "Ensure to select YES on the next security screen"
'Application.Visible = True


Call Mail_Selection_Range_Outlook_Body
Sheet1.Range("k4:k8").Select
Selection.Clear





Unload UserForm1
ActiveWorkbook.Save
Application.Quit


Else

MsgBox "Network cable unpluged/faulty" & vbNewLine & vbNewLine & _
"Use the page that print to fax to 000 000 0000"


Application.Sheets(Sheet1).PrintOut
Unload UserForm1
ActiveWorkbook.Save
Application.Quit


End If

End If


End Sub


Private Sub CommandButton3_Click()

UserForm1.Hide
UserForm2.Show

End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default workbook used to open but now crash with File/path error

pswanie,

Sorry... still not enough to go on. I loaded the code, but I cannot find a
reason for a crash with what you have posted. I had to disable the following
sub-routine calls due to the code not being posted just to run a user form.


Call check4internet

and this one

Call Mail_Selection_Range_Outlook_Body


I might be able to offer more help if you can email me this file.

My email is wmivey6311 at hotmail dot com.

Mark


"pswanie" wrote in message
...
got it narrowed down to when ever i point/go to userform1

this is what i got in userfrom1


'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''



Private Sub CommandButton4_Click()
Application.Visible = True

Unload UserForm1
Sheets("Sheet1").Select
ActiveWorkbook.Save
Application.Quit
End Sub


Private Sub CommandButton5_Click()
Unload UserForm1
UserForm1.Show
End Sub


Private Sub UserForm_activate()

'UserForm1.TextBox1.Value = ""
'UserForm1.CheckBox1.Value = False
'UserForm1.CheckBox2.Value = False
'UserForm1.CheckBox3.Value = False
'UserForm1.CheckBox4.Value = False
'UserForm1.CheckBox5.Value = False

End Sub

Private Sub UserForm_Initialize()

Me.TextBox1.Value = ""
Me.CheckBox1.Value = False
Me.CheckBox2.Value = False
Me.CheckBox3.Value = False
Me.CheckBox4.Value = False
Me.CheckBox5.Value = False
Call check4internet

End Sub

'prevent user clicking red "x"
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
End If
End Sub





Private Sub CommandButton1_Click()

If TextBox1 = "" Then
MsgBox "Please enter a description"
Else

Sheet1.Range("E1").Select
ActiveCell.FormulaR1C1 = "=username()"



If Worksheets("sheet1").Range("H30").Value = True Then


MsgBox "Ensure to select YES on the next security screen"
'Application.Visible = True


Call Mail_Selection_Range_Outlook_Body
Sheet1.Range("k4:k8").Select
Selection.Clear





Unload UserForm1
ActiveWorkbook.Save
Application.Quit


Else

MsgBox "Network cable unpluged/faulty" & vbNewLine & vbNewLine & _
"Use the page that print to fax to 000 000 0000"


Application.Sheets(Sheet1).PrintOut
Unload UserForm1
ActiveWorkbook.Save
Application.Quit


End If

End If


End Sub


Private Sub CommandButton3_Click()

UserForm1.Hide
UserForm2.Show

End Sub




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default workbook used to open but now crash with File/path error

On Feb 25, 6:04*am, pswanie wrote:
office excell 2003
windows xp

i been working on a .xlssheet with 3 userforms and about 8 usermodules.

to start i got

///////////////////////////////////////////////////////////////////////////*////////////////////
Private Sub Workbook_Open()
Sheets("Sheet1").Select
* * Worksheets("sheet1").Range("K4").Value = False
* * Worksheets("sheet1").Range("K5").Value = False
* * Worksheets("sheet1").Range("K6").Value = False
* * Worksheets("sheet1").Range("K7").Value = False
* * Worksheets("sheet1").Range("K8").Value = False

* *With Application
* * * * .Calculation = xlCalculationAutomatic
* * * * .MaxChange = 0.001
* * End With

* * Application.Visible = False

UserForm1.Show

UserForm1.TextBox1.Value = ""
UserForm1.CheckBox1.Value = False
UserForm1.CheckBox2.Value = False
UserForm1.CheckBox3.Value = False
UserForm1.CheckBox4.Value = False
UserForm1.CheckBox5.Value = False

End Sub
///////////////////////////////////////////////////////////////////////////*////////////////////

when i select disable macro's the workbook dont crash but if i enable it
does....

///////////////////////////////////////////////////////////////////////////*////////////////////
file/path access error
///////////////////////////////////////////////////////////////////////////*////////////////////

and when i go and look at therepairlog i get

///////////////////////////////////////////////////////////////////////////*/////////////////////
Microsoft Office Excel FileRepairLog

Errors were detected in file 'C:\files\Jobcard.xls'
The following is a list of repairs:

Lost Visual Basic project.
///////////////////////////////////////////////////////////////////////////*////////////////////


Maybe you should try a popular Excel file recovery tool called
Advanced Excel Repair to repair your Excel file. It is a powerful tool
to repair corrupt or damaged Excel files.

Detailed information about Advanced Excel Repair can be found at
http://www.datanumen.com/aer/

And you can also download a free demo version at http://www.datanumen.com/aer/aer.exe

Hope this will help.

Alan
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
File crash when I try to open GOH Excel Discussion (Misc queries) 0 May 21st 08 02:40 PM
How to find file-path of open workbook? Larryq22 Excel Discussion (Misc queries) 7 January 24th 08 03:38 AM
Excel crash when exiting with the Workbook open Alain Vaillancourt Excel Programming 3 September 13th 07 07:13 PM
Word and Excel crash when I try to open a folder to get to a file DGD41 Excel Discussion (Misc queries) 7 April 15th 06 09:14 PM
Path\File name length problem Excel Crash on save as Datasort Excel Discussion (Misc queries) 0 April 8th 05 05:19 PM


All times are GMT +1. The time now is 08:34 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"