PDA

View Full Version : Sleeper: Unable to focus on another sheet



gersemale
06-01-2005, 07:08 AM
Hi folks,

The problem is that when I am running my macro, which prompts the user to copy information from a web generated csv file I am unable to focus on this csv file window. During this time I am unable to highlight the values in the csv file. Before I prompt the user, I set the screen updating boolean to true.



Application.ScreenUpdating = True
With .Worksheets("Paste Sheet")
.Cells(2, 55).Activate
.Paste
End With


Can anyone please help? :banghead:

Thanks

Ger

Bob Phillips
06-01-2005, 07:50 AM
The problem is that when I am running my macro, which prompts the user to copy information from a web generated csv file I am unable to focus on this csv file window. During this time I am unable to highlight the values in the csv file. Before I prompt the user, I set the screen updating boolean to true.

You need to activate thw worksheet first



Application.ScreenUpdating = True
With Worksheets("Paste Sheet")
.Activate
.Cells(2, 55).Activate
.Paste
End With

Norie
06-01-2005, 08:21 AM
Why not just this?


Worksheets("Paste Sheet").Cells(2, 55).PasteSpecial xlAll

gersemale
06-02-2005, 07:22 AM
Hi and thanks, however the problem still exists

I have change the code to read as below:


Public Sub continueSatisfaction()
ActiveWorkbook.Worksheets("Paste Sheet").Activate
ActiveSheet.Range("AX2:AZ99").Clear
ActiveSheet.Range("BC2:BE99").Clear
ActiveSheet.Range("BH2:BJ99").Clear
Application.ScreenUpdating = True
If MsgBox("Please copy Results A and click ok", vbOKCancel, "Satisfation Results") = vbCancel Then
Exit Sub
End If
Worksheets("Paste Sheet").Cells(2, 50).PasteSpecial (xlAll)
If MsgBox("Please copy Results B and click ok", vbOKCancel, "Satisfation Results") = vbCancel Then
Exit Sub
End If
Worksheets("Paste Sheet").Cells(2, 55).PasteSpecial (xlAll)
If MsgBox("Please copy Results C and click ok", vbOKCancel, "Satisfation Results") = vbCancel Then
Exit Sub
End If
Worksheets("Paste Sheet").Cells(2, 60).PasteSpecial (xlAll)
End Sub

When this module is running I am unable to select the CSV file, which contains the information I need to copy. This is a web resource and is loaded into Internet Explorer.

Any ideas?

Thanks,

Ger

gersemale
06-02-2005, 09:02 AM
Ok looking through the forum I think i may have something:

Do i need to use vbModeless? If so do I need to create my own form?