Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Referencing sheet on a web browser

I have a sheet that calculates pricing projections which gets its info from a
form that pops up when the user clicks a button. The file is posted on the
intranet and works fine when it is saved on to the desktop. The problem
occurs when the user selects 'Open' and the file is opened in a web browser.
I get a "Run-time error '91': Object variable or With block variable not set"
error on the fifth line:

Private Sub cmdCalc_Click()
Dim vEmpty As String
Dim vNumeric As String

ActiveWorkbook.Sheets("Business Account Pricing").Activate <-------
Range("A1").Select

' Check user input

If Me.txtECR.Value = "" Then
vEmpty = Chr(149) & " Earnings Credit Rate" & vbNewLine
Else
If IsNumeric(txtECR.Value) = True Then
Range("C147").Value = txtECR.Value
End If
End If
....

Is there a way to have this work when its saved on the desktop or opened in
a web browser?
Thanks for any help
Jon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Referencing sheet on a web browser

try this

Private Sub cmdCalc_Click()
Dim vEmpty As String
Dim vNumeric As String

with ActiveWorkbook.Sheets("Business Account Pricing")


' Check user input

If Me.txtECR.Value = "" Then
vEmpty = Chr(149) & " Earnings Credit Rate" & vbNewLine
Else
If IsNumeric(txtECR.Value) = True Then
.Range("C147").Value = txtECR.Value
End If
End If
end with

"jeq214" wrote:

I have a sheet that calculates pricing projections which gets its info from a
form that pops up when the user clicks a button. The file is posted on the
intranet and works fine when it is saved on to the desktop. The problem
occurs when the user selects 'Open' and the file is opened in a web browser.
I get a "Run-time error '91': Object variable or With block variable not set"
error on the fifth line:

Private Sub cmdCalc_Click()
Dim vEmpty As String
Dim vNumeric As String

ActiveWorkbook.Sheets("Business Account Pricing").Activate <-------
Range("A1").Select

' Check user input

If Me.txtECR.Value = "" Then
vEmpty = Chr(149) & " Earnings Credit Rate" & vbNewLine
Else
If IsNumeric(txtECR.Value) = True Then
Range("C147").Value = txtECR.Value
End If
End If
...

Is there a way to have this work when its saved on the desktop or opened in
a web browser?
Thanks for any help
Jon

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Referencing sheet on a web browser

Its still giving me the same error.

"Joel" wrote:

try this

Private Sub cmdCalc_Click()
Dim vEmpty As String
Dim vNumeric As String

with ActiveWorkbook.Sheets("Business Account Pricing")


' Check user input

If Me.txtECR.Value = "" Then
vEmpty = Chr(149) & " Earnings Credit Rate" & vbNewLine
Else
If IsNumeric(txtECR.Value) = True Then
.Range("C147").Value = txtECR.Value
End If
End If
end with

"jeq214" wrote:

I have a sheet that calculates pricing projections which gets its info from a
form that pops up when the user clicks a button. The file is posted on the
intranet and works fine when it is saved on to the desktop. The problem
occurs when the user selects 'Open' and the file is opened in a web browser.
I get a "Run-time error '91': Object variable or With block variable not set"
error on the fifth line:

Private Sub cmdCalc_Click()
Dim vEmpty As String
Dim vNumeric As String

ActiveWorkbook.Sheets("Business Account Pricing").Activate <-------
Range("A1").Select

' Check user input

If Me.txtECR.Value = "" Then
vEmpty = Chr(149) & " Earnings Credit Rate" & vbNewLine
Else
If IsNumeric(txtECR.Value) = True Then
Range("C147").Value = txtECR.Value
End If
End If
...

Is there a way to have this work when its saved on the desktop or opened in
a web browser?
Thanks for any help
Jon

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Referencing sheet on a web browser

Does changing active to this make any differences

from
with ActiveWorkbook.Sheets("Business Account Pricing")

to
with ThisWorkbook.Sheets("Business Account Pricing")

This workbook is the workbook where the macro is located.


"jeq214" wrote:

Its still giving me the same error.

"Joel" wrote:

try this

Private Sub cmdCalc_Click()
Dim vEmpty As String
Dim vNumeric As String

with ActiveWorkbook.Sheets("Business Account Pricing")


' Check user input

If Me.txtECR.Value = "" Then
vEmpty = Chr(149) & " Earnings Credit Rate" & vbNewLine
Else
If IsNumeric(txtECR.Value) = True Then
.Range("C147").Value = txtECR.Value
End If
End If
end with

"jeq214" wrote:

I have a sheet that calculates pricing projections which gets its info from a
form that pops up when the user clicks a button. The file is posted on the
intranet and works fine when it is saved on to the desktop. The problem
occurs when the user selects 'Open' and the file is opened in a web browser.
I get a "Run-time error '91': Object variable or With block variable not set"
error on the fifth line:

Private Sub cmdCalc_Click()
Dim vEmpty As String
Dim vNumeric As String

ActiveWorkbook.Sheets("Business Account Pricing").Activate <-------
Range("A1").Select

' Check user input

If Me.txtECR.Value = "" Then
vEmpty = Chr(149) & " Earnings Credit Rate" & vbNewLine
Else
If IsNumeric(txtECR.Value) = True Then
Range("C147").Value = txtECR.Value
End If
End If
...

Is there a way to have this work when its saved on the desktop or opened in
a web browser?
Thanks for any help
Jon

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Referencing sheet on a web browser

That did the trick. Thanks a bunch. Appreciate your help.

"Joel" wrote:

Does changing active to this make any differences

from
with ActiveWorkbook.Sheets("Business Account Pricing")

to
with ThisWorkbook.Sheets("Business Account Pricing")

This workbook is the workbook where the macro is located.


"jeq214" wrote:

Its still giving me the same error.

"Joel" wrote:

try this

Private Sub cmdCalc_Click()
Dim vEmpty As String
Dim vNumeric As String

with ActiveWorkbook.Sheets("Business Account Pricing")


' Check user input

If Me.txtECR.Value = "" Then
vEmpty = Chr(149) & " Earnings Credit Rate" & vbNewLine
Else
If IsNumeric(txtECR.Value) = True Then
.Range("C147").Value = txtECR.Value
End If
End If
end with

"jeq214" wrote:

I have a sheet that calculates pricing projections which gets its info from a
form that pops up when the user clicks a button. The file is posted on the
intranet and works fine when it is saved on to the desktop. The problem
occurs when the user selects 'Open' and the file is opened in a web browser.
I get a "Run-time error '91': Object variable or With block variable not set"
error on the fifth line:

Private Sub cmdCalc_Click()
Dim vEmpty As String
Dim vNumeric As String

ActiveWorkbook.Sheets("Business Account Pricing").Activate <-------
Range("A1").Select

' Check user input

If Me.txtECR.Value = "" Then
vEmpty = Chr(149) & " Earnings Credit Rate" & vbNewLine
Else
If IsNumeric(txtECR.Value) = True Then
Range("C147").Value = txtECR.Value
End If
End If
...

Is there a way to have this work when its saved on the desktop or opened in
a web browser?
Thanks for any help
Jon



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
Sheet Referencing - autofilling sheet names Pat Excel Worksheet Functions 2 June 4th 09 03:50 AM
how do I print a web saved Excel sheet from my browser? Bomber Excel Discussion (Misc queries) 0 August 7th 07 11:02 PM
copy formula referencing sheet name to another sheet Tat Excel Worksheet Functions 1 June 26th 05 03:00 AM
referencing a sheet named in a cell then using data from that sheet gbeard Excel Worksheet Functions 4 April 15th 05 08:42 AM
referencing a sheet in VB Mary Agnes Excel Programming 3 February 5th 04 02:41 PM


All times are GMT +1. The time now is 10:44 AM.

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"