Need help with opening workbook from web page, please

rogersj

Board Regular
Joined
Aug 13, 2002
Messages
187
myName = ThisWorkbook.Name

If Range("O7") = "Tech - Body" Then

Workbooks.Open FileName:= _
"Q:Body - Chassis.xls"
Sheets("Body").Select
Rows("2:2").Select
Selection.insert Shift:=xlDown
Windows(myName).Activate
Range("B1").Select
Selection.Copy
Windows("Body - Chassis.xls").Activate
Range("A2").Select
ActiveSheet.Paste
Windows(myName).Activate
ActiveWindow.SmallScroll Down:=11
Range("B12").Select
Application.CutCopyMode = False



If the document is opened from a web site, it saves the document in a temp dir, as a temp name. I can't run this macro without getting a "Subscript out of range" I select debug and it points to "Windows(myName).Activate"

Im not sure if this matters but it does open this file as a Read Only. If I save this file as any name, to my HDD, it will run just fine. But I would like to be able to launch this file from the website, and run the macro.

Any tips? Thank you
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
can you not input an activeworkbook.SaveAs at the beginning of the macro and thus avoid the temp directory problem, or an if so if the file name = designated file name then cool, if not ActiveWorkbook.SaveAs etc?
 
Upvote 0
Hmmm.. ::ponder:: I've never thoguht of that... Saving the macro to the users temp dir. That should rid the 'Read Only'.

How could I: ActiveWorkbook.SaveAs C:WindowsTemptemp.xls overwrite = yes?

Overwrite so the next time they run the macro it dont ask to overwrite.
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,915
Members
448,532
Latest member
9Kimo3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top