Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I have no idea why this is giving me a error: Windows(dataFile).Activate

I am coverting a Excel 97 spreadsheet to work with a new computer with
Excel 2003 installed, I am having some problems with querying collected
statistics to the data report file, I am getting the following error.

I am getting a "Run-time error '13' Type mismatch


Sub addStatsToDataFile()
'adds the collected statistics (max and min right now) to the data
report file
Dim x As Integer
Dim localResult As Variant

Application.StatusBar = "Adding statistical data in " & dataFile
Windows(dataFile).Activate ' THIS IS WHAT IS HIGHLIGHTED
WHEN I COMPILE
Application.ScreenUpdating = False
Selection.Name = "home" 'the current cell should be the last cell
(serial number column)
Selection.Formula = "max:"
stepRight 1
For x = 1 To numberOfTests
localResult = scaleStr(maxValue(x))
Selection.Formula = localResult
stepRight 1
If x 1 And x Mod 10 = 1 Then 'vertical page break after 10
columns...
Selection.Formula = "max:"
stepRight 1
End If
Next x
Range("home").Select
stepDown 1
Selection.Formula = "min:"
stepRight 1
For x = 1 To numberOfTests
localResult = scaleStr(minValue(x))
Selection.Formula = localResult
stepRight 1
If x 1 And x Mod 10 = 1 Then 'vertical page break after 10
columns...
Selection.Formula = "min:"
stepRight 1
End If
Next x
Range("home").Select
End Sub


I am new to using VBA for Excel but I am a quick study, I need to pick
up where the last sys admin left off.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default I have no idea why this is giving me a error: Windows(dataFile).Ac

replace the line
Windows(dataFile).Activate
with
Workbook(datafile).Activate

"madlinux" wrote:

I am coverting a Excel 97 spreadsheet to work with a new computer with
Excel 2003 installed, I am having some problems with querying collected
statistics to the data report file, I am getting the following error.

I am getting a "Run-time error '13' Type mismatch


Sub addStatsToDataFile()
'adds the collected statistics (max and min right now) to the data
report file
Dim x As Integer
Dim localResult As Variant

Application.StatusBar = "Adding statistical data in " & dataFile
Windows(dataFile).Activate ' THIS IS WHAT IS HIGHLIGHTED
WHEN I COMPILE
Application.ScreenUpdating = False
Selection.Name = "home" 'the current cell should be the last cell
(serial number column)
Selection.Formula = "max:"
stepRight 1
For x = 1 To numberOfTests
localResult = scaleStr(maxValue(x))
Selection.Formula = localResult
stepRight 1
If x 1 And x Mod 10 = 1 Then 'vertical page break after 10
columns...
Selection.Formula = "max:"
stepRight 1
End If
Next x
Range("home").Select
stepDown 1
Selection.Formula = "min:"
stepRight 1
For x = 1 To numberOfTests
localResult = scaleStr(minValue(x))
Selection.Formula = localResult
stepRight 1
If x 1 And x Mod 10 = 1 Then 'vertical page break after 10
columns...
Selection.Formula = "min:"
stepRight 1
End If
Next x
Range("home").Select
End Sub


I am new to using VBA for Excel but I am a quick study, I need to pick
up where the last sys admin left off.


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
Any idea why this is giving me a #Value! Error? msnyc07 Excel Worksheet Functions 3 March 12th 10 05:22 PM
VLOOKUP returning a #VALUE! error and I've not idea why! HELP!!! forevertrying Excel Worksheet Functions 18 June 25th 09 03:15 AM
overflow error 6.. the macro just stops any idea why? ste mac Excel Programming 4 February 7th 05 04:00 PM
Reference to a variable in windows(???).Activate John Baker Excel Programming 7 July 13th 04 02:04 PM
using array with Windows().activate NikkoW Excel Programming 1 May 4th 04 03:15 AM


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