LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Probelm with Code !!!!!!!!!!!!!!!!!

"The specified dimension is not valid for the current chart type" error. I
can't get rid of this eror even with 2 "On Error" Statements at the bottome
of the code where I suspect the problem to be.

Private Sub cmdgetBO_Data_Click()
Dim f, ws As Worksheet, Msg
Dim BO_Datafile_Name As String, BOReport_lastColumn As String
Dim BOReport_lastRow As Integer, BOPos As Integer
Dim BOReportWS As Worksheet
Dim rngBOReport As Range, c As Range

With Application
.ScreenUpdating = True
.Calculation = xlCalculationManual
.DisplayAlerts = False
End With
'""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""'
'" THIS SECTION OF CODE RETRIVES THE BO FILES FROM THE HARD DRIVE "'
f = Application.GetOpenFilename("Excel Files (*.xls),*.xls")

'""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""'
'"" THIS SECTION OF CODE OPENS THE BO FILES FROM THE HARD DRIVE ""'
'""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""'
If f < "" Then
Workbooks.Open filename:=f, UpdateLinks:=0, ReadOnly:=True
BO_Datafile_Name = ActiveWorkbook.Name
Else
Unload Me
Worksheets("BO Download").Visible = True
Range("A4").Select
Exit Sub
End If

'""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""'
'"" THIS SECTION OF CODE COPIES THE BO SHEET FROM THE BO FILE ""'
'"" AND PASTE IT INTO THE SUMMARY REPORT FILE ""'
'""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""'
Workbooks(BO_Datafile_Name).Sheets(1).Select
Workbooks(BO_Datafile_Name).Sheets(1).Copy
Befo=ThisWorkbook.ActiveSheet

'"" CLOSE THE BO DOWNLOAD DATA FILE ""'
Workbooks(BO_Datafile_Name).Activate
Workbooks(BO_Datafile_Name).Close

Set BOReportWS = ThisWorkbook.Worksheets("Report 1")
BOReportWS.Activate
BOReport_lastRow = ActiveSheet.UsedRange.Rows.Count

BOReportWS.Range("B5:AX" & BOReport_lastRow).Copy
ThisWorkbook.Worksheets("BO Download").Select
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
BOReportWS.Select
BOReportWS.Delete
Application.Calculate

With Worksheets("Completions Summary").Cells
.Copy
.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End With
Range("A4").Select

Worksheets("BO Download").Select
Worksheets("BO Download").Delete
Worksheets("Completions Summary").Select
Range("B4").Select
On Error GoTo 0
On Error Resume Next
Dim filename As String
filename = Mid(ActiveWorkbook.Name, 1, Len(ActiveWorkbook.Name) - 4)
ActiveWorkbook.SaveAs filename & "_" & Format(Date, "mmmdd_yy") & ".xls"
Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
End Sub
 
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
Help with Range Probelm PLEASE ! Dan Thompson Excel Programming 4 April 10th 09 07:42 PM
Probelm with macro mac Excel Worksheet Functions 5 January 14th 08 07:47 PM
FileCopy Probelm jutlaux Excel Programming 2 November 17th 06 03:58 PM
Hyperlink probelm Glenn Richardson[_2_] Excel Programming 3 August 31st 05 09:24 AM
Hyperlink probelm Glenn Richardson Excel Worksheet Functions 2 August 30th 05 02:26 PM


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